Comments (5)
I'd recommend the code you have above, it ends up being easier to manage sagas IMO
from redux-injectors.
Got it thanks 👍
from redux-injectors.
Or you should be able to call useInjectSaga
multiple times in one function, if you were injecting unrelated sagas and it didn't make sense to combine them using the above method.
from redux-injectors.
@BenLorantfy I've tried this out - using useInjectSaga
for two sagas that correspond to the same reducerKey. For example:
export function GithubRepoForm() {
useInjectReducer({ key: sliceKey, reducer: reducer });
useInjectSaga({ key: sliceKey, saga: githubRepoFormSaga });
useInjectSaga({ key: sliceKey, saga: githubRepoFormSaga2 });
In this case, only githubRepoFormSaga2
works and githubRepoFormSaga
is overwritten
from redux-injectors.
You'd have to use a different key. In this case I'd combine them (each slice should only have one saga IMO) but if you want to inject sagas from different slices you can use useInjectSaga
with different slice keys.
from redux-injectors.
Related Issues (20)
- Typescript support? HOT 1
- Typescript error: implicit "any" HOT 1
- Change in the order of Hooks when injecting a reducer, calling it, and selector-ing it withing a single component HOT 2
- Feature Request: Ability to change the saga registered on a component using Hooks HOT 4
- React 16.13 throws a warning when "nesting" useInjectReducer calls HOT 54
- Persist state of redux HOT 9
- How do I clear state on logout HOT 2
- update to react 17 HOT 1
- Typing issues with latest @reduxjs/toolkit HOT 1
- Unmet peer dependencies with React 18 HOT 8
- incorrect typing for function `createManager` ? HOT 2
- Can I integrate to Next.Js? HOT 2
- Not able to get the store value HOT 2
- useInjectReducer clears the state HOT 2
- installing redux-injectors without --force or --legacy-peer-deps HOT 2
- [React Testing Library] Integration tests with preloadedState
- Feature request: reducer ejection HOT 1
- Unmet peer dependencies with Redux 8 HOT 5
- How to create reducer with Immer ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-injectors.