Skip to content

Commit

Permalink
Merge pull request #3 from acdlite/rename-body-to-payload
Browse files Browse the repository at this point in the history
body -> payload
  • Loading branch information
acdlite committed Jul 2, 2015
2 parents 1bc5a3f + 505114d commit 26bd6dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A basic Flux standard action:
```js
{
type: 'ADD_TODO',
body: {
payload: {
text: 'Do something.'
}
}
Expand All @@ -41,9 +41,9 @@ An action MUST
An action MAY

- have a `status` property.
- have a `body` property.
- have a `payload` property.

Properties other than for `type`, `body`, and `status` are also permitted, but they SHOULD only contain meta information about the action itself.
Properties other than for `type`, `payload`, and `status` are also permitted, but they SHOULD only contain meta information about the action itself.

### `type`

Expand All @@ -64,11 +64,11 @@ If `status` is defined but not one of `success` or `error`, the consumer MUST NO

An example of using a `status` other than `success` or `error` is if the action will be transformed before being sent to the consumer, at which point `status` can be updated.

### `body`
### `payload`

The optional `body` property can be any type of value. It represents the payload of the action. Any information about the action that is not the `type` or `status` should be part of the `body` field.
The optional `payload` property can be any type of value. It represents the payload of the action. Any information about the action that is not the `type` or `status` should be part of the `payload` field.

By convention, if the `status` is `error`, the `body` SHOULD be an error object. This is akin to rejecting a promise with an error object.
By convention, if the `status` is `error`, the `payload` SHOULD be an error object. This is akin to rejecting a promise with an error object.

## Utility functions

Expand Down

0 comments on commit 26bd6dc

Please sign in to comment.