Skip to content

Instantly share code, notes, and snippets.

@hyjk2000
Created March 25, 2016 07:57
Show Gist options
  • Select an option

  • Save hyjk2000/4b52af51afd76f8104e2 to your computer and use it in GitHub Desktop.

Select an option

Save hyjk2000/4b52af51afd76f8104e2 to your computer and use it in GitHub Desktop.
Ember Run Loop
import Ember from 'ember';
Ember.run.schedule('actions', () => {
document.writeln(1);
});
Ember.run.join(() => {
Ember.run.schedule('actions', () => {
document.writeln(2);
});
document.writeln(3);
});
Ember.run(() => {
Ember.run.schedule('actions', () => {
document.writeln(4);
});
Ember.run.schedule('actions', () => {
document.writeln(5);
});
Ember.run(() => {
Ember.run.schedule('actions', () => {
document.writeln(6);
});
document.writeln(7);
});
document.writeln(8);
});
{
"version": "0.7.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": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment