Created
October 15, 2017 06:59
-
-
Save inv2004/8ede7acbb580647f85ee4ba39338ede5 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
function reducer(state = {books: []}, action) { | |
switch (action.type) { | |
case "SET_RECOMMENDED": | |
return {books: action.payload}; | |
default: | |
state; | |
} | |
} | |
function mapStateToPros(state) { | |
console.log("state: "+state); | |
return {books: state.books}; | |
} | |
const store = createStore(reducer, {books: []}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment