Closed sjsyrek closed 5 years ago
@piotrwitek First draft. I was trying to order the function overloads correctly, but it has been non-obvious to me what counts as most specific, etc. If it's not obvious, I'm rather new to TypeScript and in the process of migrating a code base over from Flow (which is how I found this library to begin with). So I appreciate your help and patience here.
I didn't update the docs in this PR yet. I was planning to do that in a separate PR and include further proofreading changes. The next step will be figuring out createAction
but that can be a separate PR, if you prefer. The intended distinction between createAction
and createStandardAction
is still a bit fuzzy to me.
@sjsyrek After above few review comments should be good to merge
The intended distinction between
createAction
andcreateStandardAction
is still a bit fuzzy to me.
Good that you have mentioned that. The core distinction is really the preference of the user to use generic type arguments (similar to redux-actions
) or more inference driven approach, where types are inferred solely from function signature (args and returned object). With another limitation for the generic approach allowing only 2 predefined args in resulting action-creators.
@piotrwitek Should be good now
Thanks @sjsyrek for adding a great new feature!
Thank you for your contribution! :thumbsup:
Please makes sure that these checkboxes are checked before submitting your PR, thank you!
Related issues: https://github.com/piotrwitek/typesafe-actions/issues/116
npm run reinstall
npm run ci-check
For bugfixes:
For new feature: