Last active
May 12, 2016 10:08
-
-
Save oriSomething/5cca518556a4c4a97e957dc3bde50053 to your computer and use it in GitHub Desktop.
volatile test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
var volatileValue = 0; | |
export default Ember.Controller.extend({ | |
init() { | |
this._super(...arguments); | |
Ember.run.later(this, function interval() { | |
this.incrementProperty("timer"); | |
console.log(this.get("value")); | |
Ember.run.later(this, interval, 1000); | |
}, 1000); | |
}, | |
timer: 0, | |
dep: Ember.computed("value", function() { | |
var value = this.get("value"); | |
return "dep::" + value; | |
}), | |
value: Ember.computed(function() { | |
return volatileValue++; | |
}).volatile() | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.8.0", | |
"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.5.1", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment