Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

we are written new action and a new reducer, new reducer will update the existing state (product state) how to call new reducer when a new action is dispatched and old reducer for old action, but both reducers has to update the same state

question from:https://stackoverflow.com/questions/65846895/same-state-in-angular-with-different-reducer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
982 views
Welcome To Ask or Share your Answers For Others

1 Answer

If old reducer and action is ok, you shouldn't worry about them. Please create your own action with different type and provide own reducer, based on original one (I mean you can't override function as class, so my proposal is to copy-paste existing one from source code), with your new case which supports that action. StoreModule.forFeature(XXX_FEATURE, yourReducerToken)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...