Last active
September 10, 2016 01:46
-
-
Save timrourke/13360fe3751520bd72f425d0a90d6ea4 to your computer and use it in GitHub Desktop.
promise .then chaining
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 { Promise } = Ember.RSVP; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
this._super(...arguments); | |
return new Promise((resolve) => { | |
resolve(); | |
}).then(() => console.log("1", new Date().getTime())) | |
.then(() => console.log("2", new Date().getTime())) | |
.then(() => console.log("3", new Date().getTime())) | |
.then(() => console.log("4", new Date().getTime())) | |
.then(() => console.log("5", new Date().getTime())); | |
} | |
}); |
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
{ | |
"version": "0.10.4", | |
"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.7.0", | |
"ember-data": "2.7.0", | |
"ember-template-compiler": "2.7.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment