diff --git a/types/ember__runloop/ember__runloop-tests.ts b/types/ember__runloop/ember__runloop-tests.ts index 37d1fc18e4..bd4d8492a1 100644 --- a/types/ember__runloop/ember__runloop-tests.ts +++ b/types/ember__runloop/ember__runloop-tests.ts @@ -20,6 +20,26 @@ function testRun() { return 123; }); + // run(target, method) + run({}, () => { + // code to be executed within a RunLoop + return 123; + }); + + // run(target, method, ...args) + run( + {}, + () => { + // code to be executed within a RunLoop + return 123; + }, + () => { + console.log('foo'); + }, + 'bar', + {} + ); + function destroyApp(application: EmberObject) { run(application, 'destroy'); run(application, function() { diff --git a/types/ember__runloop/index.d.ts b/types/ember__runloop/index.d.ts index 9f1fd6c260..4ec525add9 100644 --- a/types/ember__runloop/index.d.ts +++ b/types/ember__runloop/index.d.ts @@ -16,7 +16,7 @@ export interface RunNamespace { * end. */ (method: (...args: any[]) => Ret): Ret; - (target: Target, method: RunMethod): Ret; + (target: Target, method: RunMethod, ...args: any[]): Ret; /** * If no run-loop is present, it creates a new one. If a run loop is * present it will queue itself to run on the existing run-loops action