Redux Resource
  • Home
  • Introduction
    • Motivation
    • Core Concepts
    • Similar Projects
    • Examples
  • Resources
    • Resource Reducers
    • Resource Objects
    • Meta
    • Lists
    • Modifying Resources
  • Requests
    • Request Objects
    • Keys
    • Names
    • Statuses
    • Request Actions
      • Updating Lists
      • Reading Resources
      • Updating Resources
      • Creating Resources
      • Deleting Resources
  • Other Guides
    • Usage With React
    • Tracking Request Statuses
    • Using Request Statuses
    • Custom Action Types
    • Migration Guides
  • Recipes
    • Forms
    • Canceling Requests
    • Unauthorized Responses
    • User Feedback
    • Related Resources
    • Caching
  • Ecosystem Extras
    • Redux Resource Action Creators
    • Redux Resource XHR
    • Redux Resource Prop Types
    • Redux Resource Plugins
      • HTTP Status Codes
      • Selection
      • Reset
      • Included Resources
  • FAQ
    • General
    • State Tree
    • Actions
    • Lists
  • API Reference
    • resourceReducer
    • getStatus
    • getResources
    • upsertResources
    • setResourceMeta
    • actionTypes
    • requestStatuses
Powered by GitBook
On this page
  • Can I store additional metadata for resources within meta?
  • Can I store additional properties on each state slice?
  • Can I store more than one resource per state slice?
  1. FAQ

State Tree

PreviousGeneralNextActions

Last updated 7 years ago

Can I store additional metadata for resources within meta?

You can, and we encourage it. We recommend that you avoid changing the values of the request statuses directly (use the built-in Action types to do this), but feel free to store anything else in there that you want.

You can use the UPDATE_RESOURCES action type to change the metadata of resources.

If you'd like to update metadata alongside a request, then you can write a for that.

A future version of Redux Resource will support this without a plugin.

Can I store additional properties on each state slice?

Yes, you can. The only requirement is that you don't change the structure of the state that you start out with: make sure that resources, meta, lists, and requests remain Objects. If you stick with that you shouldn't run into any issues.

As a convention, we recommend only storing data relevant to the resource in the slice. Use another slice for other information.

Can I store more than one resource per state slice?

We don't recommend doing this.

plugin