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

Have dispatch return a value #52

Merged
merged 5 commits into from
Nov 11, 2019
Merged

Have dispatch return a value #52

merged 5 commits into from
Nov 11, 2019

Conversation

andrasferenczi
Copy link
Contributor

This is related to #26.

A return value has been added to the dispatch and all related middleware functions. These are necessary to be able to be able to await the result of an async process (as asked in this issue on how to redux_thunk).

dynamic return value has the following advantages:

  • does not break existing API (Minor version change seems to be enough)
  • middleware return values can be chained

Dart's type system is not complex enough (as opposed to TypeScript's) to be able to write union types when you want to chain together a middleware that may return an object of type A and another that may return an object of type B. So I don't see any other meaningful way to implement return values other than dynamic.

@johnpryan Hope this can be merged soon. Thanks.

@brianegan
Copy link
Collaborator

Hey, thanks so much! We're working on version 4.x and would love to include this change. Great work!

@codecov-io
Copy link

codecov-io commented Nov 11, 2019

Codecov Report

Merging #52 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #52   +/-   ##
======================================
  Coverage    92.1%   92.1%           
======================================
  Files           2       2           
  Lines          38      38           
======================================
  Hits           35      35           
  Misses          3       3
Impacted Files Coverage Δ
lib/src/utils.dart 100% <100%> (ø) ⬆️
lib/src/store.dart 88% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2bbdac...01f5ad5. Read the comment docs.

@brianegan brianegan merged commit 167cdce into fluttercommunity:master Nov 11, 2019
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