You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm experimenting with Reducer reuse (see #110). Now I've come across problems with Reducers and AOT.
Given example:
We have invoices and orders that both have an identical model. For this, we have a single reducer that is attached to both entities in the store. For sure we want to keep the Types. Therefore we need the tagged union types. But I want to reuse my reducer. So I introduced a scope field for all actions.
But with this setup I'm currently receiving ERROR in Error encountered resolving symbol values statically.. The problem causing part is the anonymous function in the Factory. If I extract it, everything is fine but i'd loose the option to have a parameterized reducer.
Is there a nicer way?
I want to write my reducer only once, reuse actions, keep typing.
It is indeed very similar. But the offered workaround doesn't work for me, also it looks to me as if the user gave up on the advantage of a typed reduce (which I presuppose).
I've already tried to generate a reducerToken, assign my reducer to it, provide it in app.module and pass it into the store module. export const reducerToken = new InjectionToken<ActionReducerMap<RootState>>('Registered Reducers'); Object.assign(reducerToken, reducers);
Currently I'm experimenting with Reducer reuse (see #110). Now I've come across problems with Reducers and AOT.
Given example:
We have
invoices
andorders
that both have an identical model. For this, we have a single reducer that is attached to both entities in the store. For sure we want to keep the Types. Therefore we need the tagged union types. But I want to reuse my reducer. So I introduced a scope field for all actions.But with this setup I'm currently receiving
ERROR in Error encountered resolving symbol values statically.
. The problem causing part is the anonymous function in the Factory. If I extract it, everything is fine but i'd loose the option to have a parameterized reducer.Is there a nicer way?
I want to write my reducer only once, reuse actions, keep typing.
Here i prepared a minimal code example:
The text was updated successfully, but these errors were encountered: