piotrwitek / typesafe-actions

Typesafe utilities for "action-creators" in Redux / Flux Architecture
https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox
MIT License
2.41k stars 99 forks source link

Reducers: add default handler (without init action handling) #264

Open jin60641 opened 9 months ago

jin60641 commented 9 months ago

Description

Adds a defaultHandler for reducers apply https://github.com/piotrwitek/typesafe-actions/pull/241 's comments

Related issues:

Checklist

For bugfixes:

For new features:

jin60641 commented 9 months ago

@piotrwitek I've made changes to not handle the init action by default since it's not a public API. Do you also think this structure is appropriate? Additionally, I believe it would be beneficial to have a test code to check if the defaultReducer is not being called when the init action is dispatched. What do you think?