# Optimistic updates

You may pass an optional `data` object. This is dispatched from the pending action and is useful for optimistic updates.

```js
const foo = data => ({
  type: 'FOO',
  payload: {
    promise: new Promise(),
    data: data
  }
});
```

Considering the action creator above, the pending action would be described as:

```js
// pending action
{
  type: 'FOO_PENDING',
  payload: {
    data: ...
  }
}
```

# Optimistic updates

You may pass an optional `data` object. This is dispatched from the pending action and is useful for optimistic updates.

```js
const foo = data => ({
  type: 'FOO',
  payload: {
    promise: new Promise(),
    data: data
  }
});
```

Considering the action creator above, the pending action would be described as:

```js
// pending action
{
  type: 'FOO_PENDING',
  payload: data
}
```

Update action description for optimistic updates example
Update action description for optimistic updates example

The docs previously seemed to indicate that the action dispatched for `FOO_PENDING` would have a `data` key nested under `payload`, whereas the `payload` key actually references `data` from the original action directly.