Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dispatch(action) {
- if (!isPlainObject(action)) {
- throw new Error(
- 'Actions must be plain objects. ' +
- 'Use custom middleware for async actions.'
- )
- }
- if (typeof action.type === 'undefined') {
- throw new Error(
- 'Actions may not have an undefined "type" property. ' +
- 'Have you misspelled a constant?'
- )
- }
- if (isDispatching) {
- throw new Error('Reducers may not dispatch actions.')
- }
Add Comment
Please, Sign In to add comment