Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# react-state-utils
manage state global reactjs project

# ConnectGlobalState
Usage
- Connect Component to state global
```sh
class App extends Component {
render() {
return (
<div>
<h3>App Component</h3>
</div>
);
}
}

export default connectGlobalState(App);
```
- Set state global ```this.setGlobalState({ [stateName]:[stateValue] })```
```sh
this.setGlobalState({name:'Bob'})
```
- Get state global ```this.globalState.[stateName]```
```sh
this.globalState.name //Bob
```