You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
3.4 KiB

2 years ago
{"ast":null,"code":"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 `<Provider>`.\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 <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport var useStore = /*#__PURE__*/createStoreHook();","map":{"version":3,"names":["useContext","ReactReduxContext","useReduxContext","useDefaultReduxContext","createStoreHook","context","useStore","_useReduxContext","store"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-redux/es/hooks/useStore.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 `<Provider>`.\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 <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport var useStore = /*#__PURE__*/createStoreHook();"],"mappings":"AAAA,SAASA,UAAT,QAA2B,OAA3B;AACA,SAASC,iBAAT,QAAkC,uBAAlC;AACA,SAASC,eAAe,IAAIC,sBAA5B,QAA0D,mBAA1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,eAAT,CAAyBC,OAAzB,EAAkC;EACvC,IAAIA,OAAO,KAAK,KAAK,CAArB,EAAwB;IACtBA,OAAO,GAAGJ,iBAAV;EACD;;EAED,IAAIC,eAAe,GAAGG,OAAO,KAAKJ,iBAAZ,GAAgCE,sBAAhC,GAAyD,YAAY;IACzF,OAAOH,UAAU,CAACK,OAAD,CAAjB;EACD,CAFD;EAGA,OAAO,SAASC,QAAT,GAAoB;IACzB,IAAIC,gBAAgB,GAAGL,eAAe,EAAtC;IAAA,IACIM,KAAK,GAAGD,gBAAgB,CAACC,KAD7B;;IAGA,OAAOA,KAAP;EACD,CALD;AAMD;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAIF,QAAQ,GAAG,aAAaF,eAAe,EAA3C"},"metadata":{},"sourceType":"module"}