mizchi / hard-reducer

Type friendly reducer helper
56 stars 6 forks source link

Make actionCreator's `type` public #2

Closed tsugitta closed 6 years ago

tsugitta commented 6 years ago

First of all, thanks for an awesome library. This is so helpful to work with.

This might just be my idea but I want to get the action type of an actionCreator (which is now defined as _t) to use in middleware (e.g. redux-saga). typescript-fsa makes it public. How about making it public for middleware?

mizchi commented 6 years ago

Thank you for using!

IMO: Action's name is just for debugging message and catching signal in switch case. In addition, I add prefix option to build actionCreator context. It broke type inference. (and flowtype is very weak to detect string type to other files)

But anyway we may need escape hatch. _t 's naming means private value. I will expose it as type: string.

mizchi commented 6 years ago

Sorry to late. Please use v2.1.0!