In Redux, there is initial action @@INIT
.
Is possible to dispatch another action (in middleware) when this action occurred?
If not, what is best alternative to push action after store is ready?
In Redux, there is initial action @@INIT
.
Is possible to dispatch another action (in middleware) when this action occurred?
If not, what is best alternative to push action after store is ready?
According to https://github.com/reactjs/redux/issues/186
@@INIT
How to push initial Redux
actions then?
Without library:
const store = createStore(...);
store.dispatch(...)
In middleware like Redux Saga
:
function * initialSaga() {
yield put({ ... })
}
export default function * root() {
yield fork(initialSaga);
}
© 2022 - 2024 — McMap. All rights reserved.