Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Jul 2, 2015
1 parent 5191f36 commit c1dee83
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,22 @@ By convention, if the `status` is `error`, the `body` SHOULD be an error object.

## Utility functions

The module `flux-standard-action` is available on npm. It exports a helper method `isFSA()`, which returns true if an action is a Flux Standard Action.
The module `flux-standard-action` is available on npm. It exports a few utlity functions.

```js
import { isFSA } from 'flux-standard-action';

expect(isFSA({ type: 'ACTION_TYPE' })).to.be.true;
import { isFSA, isSuccess, isError } from 'flux-standard-action';
```
### `isFSA(action)`

Returns true if `action` is FSA compliant.

### `isSuccess(action)`

Returns true if `action` should be interpreted by consumer as successful.

Additional utilities yet to be implemented:
### `isError(action)`

- `isSuccess()` - returns true if consumer should treat action as successful
- `isError()` - returns true if consumer should treat action as a failure
Returns true if `action` should be interpreted by consumer as unsuccessful. Note that this is not a perfect inverse of `isSuccess`. For example, if the status of `action` is `'pending'`, the action should be interpreted as neither successful nor unsuccessful — it should be ignored.

## Libraries

Expand Down

0 comments on commit c1dee83

Please sign in to comment.