Skip to content

Deprecation: script template helpers

Dylan Piercey edited this page Dec 27, 2018 · 3 revisions

Deprecate <script template-helpers> and <script marko-init>

Old:

<script template-helpers>
   function sum(a, b) {
      return a + b;
   }
</script>

<div>The sum of 1 + 2 is ${sum(1, 2)}</div>

New:

static function sum(a, b) {
   return a + b;
}

<div>The sum of 1 + 2 is ${sum(1, 2)}</div>

For more information checkout out https://github.com/marko-js/marko/issues/547.