Created
October 30, 2017 09:31
-
-
Save hendrikswan/c70341c221327ea068b3cacd003fe6be to your computer and use it in GitHub Desktop.
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
const handleDrawingEvent = line => ({ | |
line, | |
type: 'LINE_DRAWN' | |
}) | |
const defaultState = { lines: [] }; | |
const reducer = (state = defaultState, action) => { | |
switch (action.type) { | |
case 'LINE_DRAWN': | |
return { ...state, lines: [...state.lines, action.line] }; | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment