Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 473 Bytes

passing-extra-values-to-reducer.md

File metadata and controls

25 lines (19 loc) · 473 Bytes

Passing extra values to reducer

When returning an object from an action, only the payload and type attributes would be passed to the reducer.

Consider this example:

{
 type: 'ACTION`,
 payload: new Promise(),
 extraValue: 123
}

Here, reducer would not receive the extraValue property. In order to pass extra attributes, you need to include it as part of the meta attribute.

{
 type: 'ACTION`,
 payload: new Promise(),
 meta: {extraValue: 123}
}