💫
Promise Middleware
  • Introduction
  • Getting Started
    • Introduction
    • Design Principles
  • Guides
    • Catching Errors Thrown by Rejected Promises
    • Chaining Actions
    • Comparison to other promise middleware
    • Custom Type Delimiters
    • Custom Types
    • Optimistic Updates
    • Use with Async/Await
    • Use with Reducers
    • Use with Redux Actions
    • Use with Redux Promise Actions
    • Use with Promises Resolved with Null Values
  • Upgrade Guides
    • Upgrade from 5.x to 6.0.0
    • Upgrade from 4.x to 5.0.0
    • Upgrade from 3.x to 4.0.0
    • Release History
Powered by GitBook
On this page
  1. Guides

Custom Types

In the case you need to use different type suffixes, you can configure this globally for all actions or locally (action-by-action).

To change suffixes, you can supply an optional configuration object to the middleware. This object accepts an array of suffix strings that can be used instead of the default with a key of promiseTypeSuffixes.

import { createPromise } from 'redux-promise-middleware';

applyMiddleware(
  createPromise({
    promiseTypeSuffixes: ['LOADING', 'SUCCESS', 'ERROR']
  })
)
PreviousCustom Type DelimitersNextOptimistic Updates

Last updated 6 years ago