Created
November 26, 2015 07:22
-
-
Save gregtap/518bac859cb3b424aae5 to your computer and use it in GitHub Desktop.
✘ Error: Assertion Failed: calling set on destroyed object
This file contains hidden or 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'; | |
| const { Service, run } = Ember; | |
| /** | |
| * Ticking clock service. | |
| * We use this service to sync all our momentjs udpates every second | |
| * and not start one timer for each message. | |
| */ | |
| export default Service.extend({ | |
| init: function() { | |
| this.seconds = 0; | |
| //run.later(this, this.giveMeATick, 1000); | |
| }, | |
| giveMeATick: function() { | |
| this.set('tick', this.seconds); | |
| this.seconds += 1; | |
| //run.later(this, this.giveMeATick, 1000); | |
| }, | |
| willDestroy: function() { | |
| run.cancel(this.giveMeATick); | |
| }, | |
| }); | |
| // Even though willDestroy is called I get the | |
| // ✘ Error: Assertion Failed: calling set on destroyed object | |
| // in my test. | |
| // If both run.later calls are commented out then no errors. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment