typesafe-actions icon indicating copy to clipboard operation
typesafe-actions copied to clipboard

Reducers: add default handler (without init action handling)

Open jin60641 opened this issue 1 year ago • 1 comments

Description

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

Related issues:

  • Resolved #156

Checklist

  • [x] I have read CONTRIBUTING.md
  • [x] I have linked all related issues above
  • [ ] I have rebased my branch

For bugfixes:

  • [ ] I have added at least one unit test to confirm the bug have been fixed
  • [ ] I have checked and updated TOC and API Docs when necessary

For new features:

  • [x] I have added entry in TOC and API Docs
  • [x] I have added a short example in API Docs to demonstrate new usage
  • [x] I have added type unit tests with dts-jest
  • [x] I have added runtime unit tests with dts-jest

jin60641 avatar Dec 19 '23 03:12 jin60641

@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?

jin60641 avatar Dec 19 '23 03:12 jin60641