"use strict"; exports.__esModule = true; exports.createStoreHook = createStoreHook; exports.useStore = void 0; var _react = require("react"); var _Context = require("../components/Context"); var _useReduxContext2 = require("./useReduxContext"); /** * Hook factory, which creates a `useStore` hook bound to a given context. * * @param {React.Context} [context=ReactReduxContext] Context passed to your ``. * @returns {Function} A `useStore` hook bound to the specified context. */ function createStoreHook(context) { if (context === void 0) { context = _Context.ReactReduxContext; } var useReduxContext = context === _Context.ReactReduxContext ? _useReduxContext2.useReduxContext : function () { return (0, _react.useContext)(context); }; return function useStore() { var _useReduxContext = useReduxContext(), store = _useReduxContext.store; return store; }; } /** * A hook to access the redux store. * * @returns {any} the redux store * * @example * * import React from 'react' * import { useStore } from 'react-redux' * * export const ExampleComponent = () => { * const store = useStore() * return
{store.getState()}
* } */ var useStore = /*#__PURE__*/createStoreHook(); exports.useStore = useStore;