Skip to content

Instantly share code, notes, and snippets.

@jasonmit
Created January 9, 2019 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonmit/9a896176be8ec02b601816b29fd0dd4c to your computer and use it in GitHub Desktop.
Save jasonmit/9a896176be8ec02b601816b29fd0dd4c to your computer and use it in GitHub Desktop.
ember discuss question
import { task } from 'ember-concurrency';
export default Controller.extend({
setup: task(function*() {
yield delay(6000);
this.set('model', { message: '1' });
yield delay(4000);
this.set('model', { message: '2' });
yield delay(2000);
this.set('model', { message: '3' });
})
})
export default Route.extend({
setupController(controller) {
this._super(...arguments);
controller.get('setup').perform();
}
});
{{model.message}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment