Redux Resource Prop Types
Last updated
Last updated
A collection of objects.
Old Documentation
Migration Guides
Install redux-resource-prop-types
with npm:
npm install redux-resource-prop-types --save
Then, import the prop types that you need:
We recommend using the prop types in this library to build your own prop types, which you can reuse throughout your application.
idPropType
Validates a single resource ID.
Tip: This prop type requires that your IDs be either strings or numbers.
statusPropType
requestStatusPropType
resourcePropType
Validates a resource. Similar to PropTypes.shape()
, except that it enforces an ID.
requestPropType
If you're using React, refer to the guide on how to use the exported prop types. If you're not using React, refer to the documentation of the library.
Validates the object returned by .
Validates that a value is one of the . Typically, you'll want to use statusPropType
instead, but this can be useful when verifying the structure of your slice.
Validates a . Similar to PropTypes.shape()
, except that it enforces ids
, status
, requestKey
and resourceType
. Typically, you won't need to use this, but it can be useful to verify the structure of your state.