This section is about createContext
, Context.Provider
and Context.Consumer
usage
createContext
– there will likely be a wrapper around this.createResourceContext
?- Context.Provider is created for you, as users are not going to be in control of the value in Context
- Users will likely use a wrapper of Context.Provider that sets up all of the individual resource providers (or maybe just one Provider, if I go the unstated route)
- Users could use Context.Consumers + Composer, but what is the point? They could just as easily use a single wrapper Consumer that knows about all of the resources
- Subscription-based (that is not necessarily the final language)
- Subscribe to resources from the cache using a component
- Also supply fetchers. GET fetches are dispatched immediately, others are not
- The data returned by the fetchers are merged into your subscription
- It is similar to Apollo, except the query into the store does not map 1:1 to a request