zustandjs / zustand-slices

A slice utility for Zustand
MIT License
137 stars 6 forks source link

Set `withActions` return type to `never` in case of invalid actions #13

Closed grigorischristainas closed 1 month ago

grigorischristainas commented 2 months ago

If you agree, I think it would be better to keep a consistent return type for withActions in case of invalid actions, similar to withSlices. So I made a small change in order to return never in case IsValidActions equals false.

Please feel free to close this PR if you find this change unnecessary.

dai-shi commented 2 months ago

Oh, yeah, I agree. That was my intention too. My bad. Thanks for the catch.

Would you be interested in implementing IsValidActions?

grigorischristainas commented 1 month ago

Sure, I would like to implement it. Should I open a separate PR for it ?

dai-shi commented 1 month ago

Sure, I would like to implement it. Should I open a separate PR for it ?

Yeah, that would be great. Let's merge this.