You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.
MVP requires a property of store on Provider. I dream of a day where a Babel Transform can assume all of the store's structure for you so you don't have to map these things. By observing the relationship of components to state, I think it should be inferable.
API for default state?
This is an unknown, but if the state is not needed as a default argument, there has to be a way to set the default state. Initial thoughts are a callback of a sort.
MVP requires a property of
store
onProvider
. I dream of a day where a Babel Transform can assume all of the store's structure for you so you don't have to map these things. By observing the relationship of components to state, I think it should be inferable.API for default state?
This is an unknown, but if the state is not needed as a default argument, there has to be a way to set the default state. Initial thoughts are a callback of a sort.
<Provider defaultState={() => { foo: 'bar', x: true }} />
Knowing store shape benefits
If we can probably infer the store shape, we can also then do a
propType
type thing to make sure updatedState doesn't break the shape. For example:If we know that
state.x
is an array, and somebody's action tries to set it to a string, then the store API is broken.This should throw an error because the state is inferred to be an array from either some default data, or through introspection of other components.
The text was updated successfully, but these errors were encountered: