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

Add “real world” example #460

Merged
merged 2 commits into from
Aug 11, 2015
Merged

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Aug 11, 2015

@gaearon gaearon changed the title Add async example Add “real world” example Aug 11, 2015
@gaearon
Copy link
Contributor Author

gaearon commented Aug 11, 2015

Renaming this to “real world” example.

It has:

  • data fetching in response to routing;
  • response normalization;
  • entity cache;
  • PAGINATION!

gaearon added a commit that referenced this pull request Aug 11, 2015
@gaearon gaearon merged commit 41e609d into breaking-changes-1.0 Aug 11, 2015
@gaearon gaearon deleted the add-async-example branch August 11, 2015 23:40
@gaearon
Copy link
Contributor Author

gaearon commented Aug 11, 2015

Bonus: it has error handling too. :-)

@ghost
Copy link

ghost commented Aug 12, 2015

nice! :)

}

componentWillMount() {
loadData(this.props);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaearon Looking at this example made me think about how to prevent duplicate fetching of data when you have multiple views all interested in the same information (triggering actions in componentWillMount, like you do here), so I made this: redux-requests. Would love to get your feedback on it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. 👍
If you'd like, you can also adopt a convention like https://github.com/acdlite/flux-standard-action (see https://github.com/acdlite/redux-promise as an example middleware using it)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gaearon! I actually tried to follow FSA (using meta); once the "sequence" stuff gets figured out maybe I can change the API to support that.

If you get a chance, I'd love your opinion on a better way to "cancel" entire Action Creator sequences via middleware (or something else)

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