diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c8935 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..29aee22 --- /dev/null +++ b/README.md @@ -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 ( +
+

App Component

+
+ ); + } + } + + 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 + ```