upsertResources
Add new or update existing resources in your state tree.
Arguments
resources
(Object): The current resources object from your state tree.newResources
(Array|Object): The new resources to add or update.[
mergeResources
] (Boolean): Whether or not to merge individual resources with the existing resource in the store, or to replace it with the new data. Defaults totrue
.
Returns
(Object
): The updated resources object.
Example
Tips
This is used internally within the reducer returned by
store. You will typically only need to use this function if you're authoring a
Last updated