Skip to content

Commit

Permalink
Merge pull request #460 from carystanley/fix-nocallback-1281
Browse files Browse the repository at this point in the history
Fix to devtools-plugin to support Actions without a "callback" param
  • Loading branch information
lingyan authored Jul 19, 2016
2 parents 65a2bfc + 670e5b1 commit fe7694a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/fluxible-plugin-devtools/src/lib/devtools-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export default function devToolsPlugin() {
return action(ctx, payload, cb);
}

function timedActionNoCallback(ctx, payload) {
return timedAction(ctx, payload);
}

function timedCallback(err, data) {
const endTime = Date.now();
const dur = endTime - actionReference.startTime;
Expand All @@ -155,7 +159,7 @@ export default function devToolsPlugin() {

return {
actionContext: actionContext,
action: timedAction,
action: (action.length < 3) ? timedActionNoCallback : timedAction,
payload: options.payload,
done: timedCallback
};
Expand Down

0 comments on commit fe7694a

Please sign in to comment.