Download react-boilerplate/internals/templates/utils/checkStore.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 516 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/internals/templates/utils/checkStore.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-boilerplate/internals/templates/utils/checkStore.js
-
curl -L -o checkStore.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/internals/templates/utils/checkStore.js
516 Bytes
| import { conformsTo, isFunction, isObject } from 'lodash'; | |
| import invariant from 'invariant'; | |
| /** | |
| * Validate the shape of redux store | |
| */ | |
| export default function checkStore(store) { | |
| const shape = { | |
| dispatch: isFunction, | |
| subscribe: isFunction, | |
| getState: isFunction, | |
| replaceReducer: isFunction, | |
| runSaga: isFunction, | |
| injectedReducers: isObject, | |
| injectedSagas: isObject, | |
| }; | |
| invariant( | |
| conformsTo(store, shape), | |
| '(app/utils...) injectors: Expected a valid redux store', | |
| ); | |
| } | |