From e1d62805ad9d47eaee1ca21eea1df5bd5a3132c6 Mon Sep 17 00:00:00 2001 From: Nguyen Huan Date: Fri, 27 Apr 2018 11:16:21 +0700 Subject: [PATCH] add gitignore and README.md --- .gitignore | 1 + README.md | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .gitignore create mode 100644 README.md 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 + ```