One of the most common uses of application state or application state store is working with CRUD style resources, managing the status of resource requests, fetching resources, creating resources, updating resources and more. This is currently possible using a solution such as @dojo/framework/stores but requires significant investment on the user to model data, manage statuses, fetch/update/create resources and enabling the application to provide feedback to the user (loading, failed etc).
Proposal
Create a first class API built on @dojo/framework/stores for working with resources throughout a Dojo application. The idea is that the user would not need any intimate knowledge about how the resource data is stored or even that @dojo/framework/stores is being used.
Using the Provider pattern a user would simply factory a new ResourceProvider for a specific resource type and use this as normal within application.
render() {
return <MyResourceProvider renderer={(myResource) => {
const result = myResource.getOrRead();
// do stuff with your resource result.
}} />;
}
The resource provider should be able to support the complete range of CRUD related scenarios when working with resources:
One of the most common uses of application state or application state store is working with CRUD style resources, managing the status of resource requests, fetching resources, creating resources, updating resources and more. This is currently possible using a solution such as
@dojo/framework/storesbut requires significant investment on the user to model data, manage statuses, fetch/update/create resources and enabling the application to provide feedback to the user (loading, failed etc).Proposal
Create a first class API built on
@dojo/framework/storesfor working with resources throughout a Dojo application. The idea is that the user would not need any intimate knowledge about how the resource data is stored or even that@dojo/framework/storesis being used.Using the
Providerpattern a user would simply factory a newResourceProviderfor a specific resource type and use this as normal within application.The resource provider should be able to support the complete range of CRUD related scenarios when working with resources: