{"version":3,"file":"useDispatch-PlWp8j-q.js","sources":["../../../node_modules/react-redux/es/hooks/useStore.js","../../../node_modules/react-redux/es/hooks/useDispatch.js"],"sourcesContent":["import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useStore() {\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store;\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return
{store.getState()}
\r\n * }\r\n */\n\nexport var useStore =\n/*#__PURE__*/\ncreateStoreHook();","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n var store = useStore();\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n *
\r\n * {value}\r\n * \r\n *
\r\n * )\r\n * }\r\n */\n\nexport var useDispatch =\n/*#__PURE__*/\ncreateDispatchHook();"],"names":["createStoreHook","context","ReactReduxContext","useReduxContext","useDefaultReduxContext","useContext","_useReduxContext","store","useStore","createDispatchHook","useDefaultStore","useDispatch"],"mappings":"2HAUO,SAASA,EAAgBC,EAAS,CACnCA,IAAY,SACdA,EAAUC,GAGZ,IAAIC,EAAkBF,IAAYC,EAAoBE,EAAyB,UAAY,CACzF,OAAOC,EAAAA,WAAWJ,CAAO,CAC1B,EACD,OAAO,UAAoB,CACzB,IAAIK,EAAmBH,EAAiB,EACpCI,EAAQD,EAAiB,MAE7B,OAAOC,CACR,CACH,CAiBO,IAAIC,EAEXR,EAAiB,EClCV,SAASS,EAAmBR,EAAS,CACtCA,IAAY,SACdA,EAAUC,GAGZ,IAAIM,EAAWP,IAAYC,EAAoBQ,EAAkBV,EAAgBC,CAAO,EACxF,OAAO,UAAuB,CAC5B,IAAIM,EAAQC,EAAU,EACtB,OAAOD,EAAM,QACd,CACH,CAuBU,IAACI,EAEXF,EAAkB","x_google_ignoreList":[0,1]}