I came across the following usecase (I think this also relates to #23):
First I have a reducers with some state like
{
...someState,
config,
}
This reducers needs to read from config.
Also there is some logic on how config should behave which basically has nothing to do with ...someState, hence config gets its own reducer.
So normally I would place config somewhere outside, but then I cannot access config in my first reducer (I don't want to trigger new actions using thunk or saga for this).
Without typescript-fsa-reducers I would just call the reducer for config on every action in the first reducer.
(Because of the nesting I cannot use combineReducer so I basically implement a simlar behaviour myself.)
I don't know if this is some kind of bad practice, but it seemed clean enough to me.
Unfortunatly I'm not able include a default case when I use typescript-fsa-reducers.
Because I needed a solution quite fast, I ended up forking this repo and added the possibility to add a default handler and included my fork in the project.
Now I will submit a PR that adds this functionality.
If you have any suggestion how I could do this in a similar and clean or cleaner manner without having to alter the default case, I would appreciate this, then the PR can be deleted.
I came across the following usecase (I think this also relates to #23):
First I have a reducers with some state like
This reducers needs to read from
config
. Also there is some logic on howconfig
should behave which basically has nothing to do with...someState
, henceconfig
gets its own reducer.So normally I would place
config
somewhere outside, but then I cannot accessconfig
in my first reducer (I don't want to trigger new actions using thunk or saga for this).Without
typescript-fsa-reducers
I would just call the reducer forconfig
on every action in the first reducer. (Because of the nesting I cannot usecombineReducer
so I basically implement a simlar behaviour myself.)I don't know if this is some kind of bad practice, but it seemed clean enough to me.
Unfortunatly I'm not able include a default case when I use
typescript-fsa-reducers
.Because I needed a solution quite fast, I ended up forking this repo and added the possibility to add a default handler and included my fork in the project.
Now I will submit a PR that adds this functionality.
If you have any suggestion how I could do this in a similar and clean or cleaner manner without having to alter the default case, I would appreciate this, then the PR can be deleted.