metasection of a resource slice is structured similarly to the
resourcessection: it is an object, and each of its keys is a resource ID.
You can store additional information about individual resources within
meta. You can put anything that you would like here. Typically, the information that you store within
metaare the things that are useful for the client-side application, but that don't need to be sent to the server.
Resource metadata is intended to solve the problem some developers encounter when they pollute server-side data with client-side data. Mixing the two can get messy. Use metadata to keep things organized.
The following example slice has some metadata,
selected, associated with two resources. This value could represent that a user has "selected" these resources in the UI.
// ...there are other things on a resource slice, too. But this guide will
// focus on meta.
Out of the box, Redux Resource sets some metadata on your resources for you. This metadata represents whether or not that particular resource is being created, read, updated, or deleted using a network request. The four values are: