Skip to content

Commit

Permalink
Ensure callback is wrapped in a run loop.
Browse files Browse the repository at this point in the history
This was implemented in the normal `(action` helper in
emberjs/ember.js#12519.
  • Loading branch information
rwjblue committed Feb 5, 2016
1 parent 1a71a82 commit 5c0fa72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addon/helpers/route-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const {
assert,
computed,
typeOf,
get
get,
run
} = Ember;

function getRoutes(router) {
Expand Down Expand Up @@ -43,7 +44,7 @@ export default Helper.extend({
let { action, handler } = getRouteWithAction(router, actionName);
assert(`[ember-route-action-helper] Unable to find action ${actionName}`, handler);

return action.apply(handler, args);
return run.join(handler, action, ...args);
};

action[ACTION] = true;
Expand Down

0 comments on commit 5c0fa72

Please sign in to comment.