Skip to content

WiP: feat: rewrite from scratch #28

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

WiP: feat: rewrite from scratch #28

wants to merge 22 commits into from

Conversation

julien-f
Copy link
Collaborator

@julien-f julien-f commented Mar 8, 2019

  • provideState + injectState have been replaced by withStore
  • withStore creates a new component from a store definition and a render function
  • no inheritance, use React's context if necessary
  • effects can no longer return a reducer, mutate this.state instead
  • all objects (store, state, effects) are sealed to prevent incorrect mutations

To do:

  • rewrite tests
    • render function
      • receive ro store as first param with ro effects, ro state and resetState
      • receive the ro props as second param
      • returns the React tree to render
    • computed
      • receive ro state with state and computed entries
      • cannot access itself
      • receive ro props
      • are not called when its state/props dependencies do not change
      • are called when their state or props dependencies change
      • can be async
    • effects
      • receive the passed arguments
      • receive ro store as context with ro effects, state and resetState
      • cannot set computed entries
      • can set state entries
      • cannot set new state entries
      • can use other effects
      • can call resetState
      • can be async
  • rewrite README

@julien-f julien-f force-pushed the next branch 7 times, most recently from 4e276d7 to 3e50184 Compare March 11, 2019 12:21
@GHEMID-Mohamed GHEMID-Mohamed self-requested a review March 19, 2019 09:34
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.

2 participants