Skip to content

Commit

Permalink
Warn if nothing was dispatched
Browse files Browse the repository at this point in the history
  • Loading branch information
goatslacker committed Sep 29, 2015
1 parent e3d1416 commit 3430d56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/alt/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ export default function makeAction(alt, namespace, name, implementation, obj) {
dispatch(result)
}
}

if (!newAction.dispatched && result === undefined) {
if (typeof console !== 'undefined') {
console.warn('An action was called but nothing was dispatched')
}
}

return result
}
action.defer = (...args) => {
Expand Down

0 comments on commit 3430d56

Please sign in to comment.