Created
November 19, 2015 12:01
-
-
Save bmihelac/ebba330d1a2bbd96c139 to your computer and use it in GitHub Desktop.
ES6 import typo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const UPDATE_REQUEST = 'UPDATE_REQUEST'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as types from '../constants/actionTypes'; | |
export default function pouchdbReducer(state = {}}, action) { | |
switch (action.type) { | |
case types.UPDDATE_REQUEST: | |
// there is a typo above which evaluates to `undefined` | |
// this code would never be reached - how to make it an error | |
return Object.assign({}, state, {updated: true}); | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
would raise TypeError if it is undefined.