123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- "use strict";
- exports.__esModule = true;
- exports.createReduxContextHook = createReduxContextHook;
- exports.useReduxContext = void 0;
- var _react = require("react");
- var _Context = require("../components/Context");
- function createReduxContextHook(context = _Context.ReactReduxContext) {
- return function useReduxContext() {
- const contextValue = (0, _react.useContext)(context);
- if (process.env.NODE_ENV !== 'production' && !contextValue) {
- throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');
- }
- return contextValue;
- };
- }
- const useReduxContext = createReduxContextHook();
- exports.useReduxContext = useReduxContext;
|