Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch with strongly-typed promise return types #1

Merged
merged 1 commit into from
Jun 19, 2017
Merged

Dispatch with strongly-typed promise return types #1

merged 1 commit into from
Jun 19, 2017

Conversation

mrcrowl
Copy link
Contributor

@mrcrowl mrcrowl commented Jun 4, 2017

Hi @istrib,

This PR adds versions of the dispatch/dispatchNoPayload functions with overload to return strongly-typed promise (when the wrapped action returns a promise).

Love your work.
-Ben

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 10ceee7 on mrcrowl:master into 745996a on istrib:master.

@istrib
Copy link
Owner

istrib commented Jun 19, 2017

Thanks for your great ideas, @mrcrowl . I'm going to put most of your suggestions into test.

@istrib istrib merged commit d4f070a into istrib:master Jun 19, 2017
@mrcrowl
Copy link
Contributor Author

mrcrowl commented Jun 19, 2017 via email

@mrcrowl
Copy link
Contributor Author

mrcrowl commented Jun 19, 2017 via email

@istrib
Copy link
Owner

istrib commented Jun 19, 2017

Yes, I'm delving into these ideas. Thanks!

@seantanly
Copy link

Thanks for all the work here making it easier to work on vuex in typescript! :)

May I suggest instead of having the modifiers such as Payloadless as prefix in PayloadlessActionHandler, can we have them as a suffix, i.e. ActionHandlerNoPayload ?

IMO, it makes such terms easier to discover when using auto-complete, which is working nicely for e.g. dispatch & dispatchNoPayload, commit & commitNoPayload.

@istrib
Copy link
Owner

istrib commented Jun 20, 2017

@seantanly Thanks for your suggestion. I followed it up in 0972c15 and npm package 0.1.0
dispatchNoPayload and commitNoPayload functions actually disappeared entirely, thanks to @mrcrowl suggestion to use function overloads (same commit and npm package version). The NoPayload types remain and they now follow suffix nomenclature.

@seantanly
Copy link

@istrib @mrcrowl Thanks! Just tried 0.1.0 and it's working very nicely with the enhancements you guys has enabled. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants