Guest User

Untitled

a guest
Jan 21st, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function dispatch(action) {
  2. if (!isPlainObject(action)) {
  3. throw new Error(
  4. 'Actions must be plain objects. ' +
  5. 'Use custom middleware for async actions.'
  6. )
  7. }
  8.  
  9. if (typeof action.type === 'undefined') {
  10. throw new Error(
  11. 'Actions may not have an undefined "type" property. ' +
  12. 'Have you misspelled a constant?'
  13. )
  14. }
  15.  
  16. if (isDispatching) {
  17. throw new Error('Reducers may not dispatch actions.')
  18. }
Add Comment
Please, Sign In to add comment