Created
May 21, 2019 12:15
-
-
Save js2me/891e37f8e72bddd601b7a4679d57526d 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
// ./modules/index.js | |
// don't worry about context. It links when module attaching to the store! | |
// Also all methods (like 'this.setState' ) from StonexModule class automatic will been inherited | |
const pureModule = { | |
state: {}, | |
addItem(item){ | |
this.setState({...this.state, [item.name]: item }) | |
} | |
} | |
const modules = { | |
pureModule | |
} | |
export default modules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment