diff --git a/package.json b/package.json index c3b7500..35f096e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "redux-injectors", + "name": "@the-coin/redux-injectors", "version": "1.3.0", "main": "dist/index.js", "module": "dist/index.esm.js", diff --git a/src/injectSaga.js b/src/injectSaga.js index a1b0014..cd6b957 100644 --- a/src/injectSaga.js +++ b/src/injectSaga.js @@ -84,11 +84,11 @@ export default ({ key, saga, mode }) => WrappedComponent => { const useInjectSaga = ({ key, saga, mode }) => { const store = useStore(); - const isInjected = React.useRef(false); + const isInjected = React.useRef(undefined); - if (!isInjected.current) { + if (isInjected.current != key) { getInjectors(store).injectSaga(key, { saga, mode }); - isInjected.current = true; + isInjected.current = key; } React.useEffect(