Home
Last updated
Last updated
A tiny but powerful system for managing 'resources': data that is persisted to remote servers.
✓ Removes nearly all boilerplate code for remotely-stored data ✓ Incrementally adoptable ✓ Encourages best practices like normalized state ✓ Works well with APIs that adhere to standardized formats, such as JSON API ✓ Works well with APIs that don't adhere to standardized formats, too ✓ Integrates well with your favorite technologies: HTTP, gRPC, normalizr, redux-observable, redux-saga, and more ✓ Microscopic file size (3kb gzipped!)
This website is for the v3.0.0 version of Redux Resource. The documentation for older versions are hosted elsewhere:
Migration guides to the latest version can be found here.
To install the latest version:
The quick start guide is a quick overview of basic Redux Resource usage.
The introduction explains why this library exists, and also explores alternative solutions.
This section of the guides cover resource data, resource metadata, and resource lists.
Requests represent asynchronous updates to resources. Learn more about them here.
These guides cover additional topics related to using React Request.
Recipes are recommended patterns and best practices that you can use in your application.
Redux Resource provides officially maintained bits of code that make working with the library even better.
Answers to frequently asked questions.
Describes the API of all of the exports of Redux Resource.
Follow this guide to get a taste of what it's like to work with Redux Resource.
First, we set up our store with a "resource reducer," which is a reducer that manages the state for one type of resource. In this guide, our reducer will handle the data for our "books" resource.
Once we have a store, we can start dispatching actions to it. In this example, we initiate a request to read a book with an ID of 24, then follow it up with an action representing success. There are two actions, because requests usually occur over a network, and therefore take time to complete.
Later, in your view layer, you can access information about the status of this request. When it succeeds, accessing the returned book is straightforward.
This is just a small sample of what it's like working with Redux Resource.
For a real-life webapp example that uses many more CRUD operations, check out the zero-boilerplate-redux webapp ⇗. This example project uses React, although Redux Resource works well with any view layer.
This project follows the all-contributors specification. Contributions of any kind are welcome!