Skip to content

Instantly share code, notes, and snippets.

@jgwhite
Last active November 10, 2017 07:45
Show Gist options
  • Save jgwhite/da7918e1b5cdd33b2c0c528005dec892 to your computer and use it in GitHub Desktop.
Save jgwhite/da7918e1b5cdd33b2c0c528005dec892 to your computer and use it in GitHub Desktop.
mut problem
import Ember from 'ember';
export function add(numbers) {
return numbers.reduce((sum, n) => sum + n);
}
export default Ember.Helper.helper(add);
{{#with (hash count=0) as |data|}}
<button onclick={{action (mut data.count) (add data.count 1)}}>
{{data.count}}
</button>
{{/with}}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment