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

Almin: Store#receivePayload design #312

Open
azu opened this issue Jan 17, 2018 · 5 comments
Open

Almin: Store#receivePayload design #312

azu opened this issue Jan 17, 2018 · 5 comments

Comments

@azu
Copy link
Member

azu commented Jan 17, 2018

React will introduce static getDerivedStateFromNextProps instead of componentWillReceiveProps.
reactjs/rfcs#6

Almin has similar problem about Store#receivePayload(payload).
We want to think about receivePayload design.

Problem

  • Store#receivePayload is not async safe
  • Manually call setState method
@azu
Copy link
Member Author

azu commented Mar 2, 2018

Note: Current Store has onDispatch and receivePayload lifecycle method.

  • onDispatch: call it when some UseCase#dispatch
  • receivePayload: call it when some UseCase#dispatch, did execute, and complete execute

New design should work efficiently.

@azu
Copy link
Member Author

azu commented Jun 9, 2018

getDerivedStateFromProps design guide

You Probably Don't Need Derived State - React Blog

@azu
Copy link
Member Author

azu commented Oct 29, 2018

@azu
Copy link
Member Author

azu commented Jan 22, 2019

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

No branches or pull requests

1 participant