-
Notifications
You must be signed in to change notification settings - Fork 4
Allow returning arbitrary data from the handleAction function #7
Conversation
New PR updated for the new version. From my testing it is able to detect if you have also changed the draft, and will ignore any return value if that is the case. The return value I won't have time to add tests to this PR until later tonight, sorry. |
Codecov Report
@@ Coverage Diff @@
## master #7 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 31 32 +1
Branches 5 4 -1
=====================================
+ Hits 31 32 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more request -- could you add something to the README
and maybe example.ts
? Thanks!
No problem, and happy to fix any issues with those |
Published as |
Useful for completely replacing the state when it makes more sense than modifying the current state. Acts as a sort of escape hatch for when more traditional reducer logic, including the use of higher-order array functions, is desired.
e.g.