Function

run (target, method, args*) Object public

Module: @ember/runloop
import { run } from '@ember/runloop';
target
Object
target of method to call
method
Function|String
Method to invoke. May be a function or a string. If you pass a string then it will be looked up on the passed target.
args*
Object
Any additional arguments you wish to pass to the method.
returns
Object
return value from invoking the passed function.

Runs the passed target and method inside of a RunLoop, ensuring any deferred actions including bindings and views updates are flushed at the end.

Normally you should not need to invoke this method yourself. However if you are implementing raw event handlers when interfacing with other libraries or plugins, you should probably wrap all of your code inside this call.

import { run } from '@ember/runloop';

run(function() {
  // code to be executed within a RunLoop
});

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/2.18/functions/@ember%2Frunloop/run