💫
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

Use with Promises Resolved with Null Values

If a promise is resolved with a null or undefined value, the fullfilled action will not include a payload property. This is because actions describe changes in state. Consider the following two actions:

// A
{
 type: 'ACTION`,
 meta: ...
}

// B
{
 type: 'ACTION'
 payload: null,
 meta: ...
}

Both actions describe the same change in state. This is why, when you resolve with null or undefined, the payload property is not included. It would be redundant to include it.

PreviousUse with Redux Promise ActionsNextUpgrade from 5.x to 6.0.0

Last updated 7 years ago