diff options
| author | Haishan <[email protected]> | 2018-12-20 23:35:17 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2018-12-20 23:35:17 +0800 |
| commit | 00d90f49de6ab8d2c143a2ededd23711cd0db1d3 (patch) | |
| tree | 876ec68d738f27aba75c16106cddfdc90564afff /src/misc | |
| parent | 690beda0b91a3544f857a7226219622c370089f2 (diff) | |
chore: rename useComponentState to useStoreState
Diffstat (limited to 'src/misc')
| -rw-r--r-- | src/misc/store.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/misc/store.js b/src/misc/store.js index 6f1f8aa..c44396f 100644 --- a/src/misc/store.js +++ b/src/misc/store.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { bindActionCreators } from 'redux'; import shallowEqual from './shallowEqual'; -export const StoreContext = createContext(null); +const StoreContext = createContext(null); export function Provider({ store, children }) { return ( @@ -28,7 +28,7 @@ export function useActions(actions) { return bindActionCreators(a, dispatch); } -export function useComponentState(selector) { +export function useStoreState(selector) { const store = useStore(); const initialMappedState = selector(store.getState()); const [compState, setCompState] = useState(initialMappedState); |
