-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requestuptrend project needFeature or fix needed for Uptrend project dependent on URMFeature or fix needed for Uptrend project dependent on URM
Milestone
Description
Overview
We've found it quite convenient to use ResourceLoader components to setup data loading in our containers. It has become clear that providing the other CRUD operations as child render components would be useful. So I'd like to add the following components:
New Components
NOTE: The following examples are not actually thought through so the items passed to the child render prop will likely be much different.
// --
// -- CreateResource
// --
<CreateResource resource="user" entityType="user" needle={123}>
{({create, onEventCreate, status}) => /* ... */}
</CreateResource>
// --
// -- UpdateResource
// --
<UpdateResource resource="user" entityType="user" needle={123}>
{({update, onEventUpdate, status}) => /* ... */}
</UpdateResource>
// --
// -- DeleteResource
// --
<DeleteResource resource="user" entityType="user" needle={123}>
{({delete, onEventDelete, status}) => /* ... */}
</DeleteResource> Other Possible Solutions
One thing that we could possibly do to provide this functionality is to provide functions for triggering Create, Update, Delete requests of the resource loaded by the ResourceLoader component. I highly doubt that is a good solution and even if it was it could make sense to build it from these new CrUD components.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestuptrend project needFeature or fix needed for Uptrend project dependent on URMFeature or fix needed for Uptrend project dependent on URM