Skip to content

Commit

Permalink
Merge pull request #16110 from bekzod/remove-sync
Browse files Browse the repository at this point in the history
[CLEANUP beta] remove mentions of `run.sync`
  • Loading branch information
rwjblue authored Jan 11, 2018
2 parents a650891 + 82a5da2 commit 16d61a6
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions packages/ember-metal/lib/run_loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ run.end = function() {
@property queues
@type Array
@default ['sync', 'actions', 'destroy']
@default ['actions', 'destroy']
@private
*/

Expand All @@ -246,11 +246,6 @@ run.end = function() {
```javascript
import { schedule } from '@ember/runloop';
schedule('sync', this, function() {
// this will be executed in the first RunLoop queue, when bindings are synced
console.log('scheduled on sync queue');
});
schedule('actions', this, function() {
// this will be executed in the 'actions' queue, after bindings have synced.
console.log('scheduled on actions queue');
Expand All @@ -265,8 +260,7 @@ run.end = function() {
@method schedule
@static
@for @ember/runloop
@param {String} queue The name of the queue to schedule against.
Default queues are 'sync' and 'actions'
@param {String} queue The name of the queue to schedule against. Default queues is 'actions'
@param {Object} [target] target object to use as the context when invoking a method.
@param {String|Function} method The method to invoke. If you pass a string it
will be resolved on the target object at the time the scheduled item is
Expand Down Expand Up @@ -295,31 +289,6 @@ run.cancelTimers = function() {
backburner.cancelTimers();
};

/**
Immediately flushes any events scheduled in the 'sync' queue. Bindings
use this queue so this method is a useful way to immediately force all
bindings in the application to sync.
You should call this method anytime you need any changed state to propagate
throughout the app immediately without repainting the UI (which happens
in the later 'render' queue added by the `ember-views` package).
```javascript
run.sync();
```
@method sync
@static
@for @ember/runloop
@return {void}
@private
*/
run.sync = function() {
if (backburner.currentInstance) {
backburner.currentInstance.queues.sync.flush();
}
};

/**
Invokes the passed target/method and optional arguments after a specified
period of time. The last parameter of this method must always be a number
Expand Down Expand Up @@ -442,7 +411,7 @@ run.once = function(...args) {
@method scheduleOnce
@static
@for @ember/runloop
@param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'.
@param {String} [queue] The name of the queue to schedule against. Default queues is 'actions'.
@param {Object} [target] The target of the method to invoke.
@param {Function|String} method The method to invoke.
If you pass a string it will be resolved on the
Expand Down

0 comments on commit 16d61a6

Please sign in to comment.