Skip to content

Commit

Permalink
Merge pull request #37 from georgebonnr/patch-1
Browse files Browse the repository at this point in the history
Update README.md: make bailout handling more clear
  • Loading branch information
barrystaes committed Feb 11, 2016
2 parents cd1a28a + ece14c2 commit ea1b399
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ It must be one of the following strings:

In some cases, the data you would like to fetch from the server may already be cached in you Redux store. Or you may decide that the current user does not have the necessary permissions to make some request.

You can tell `redux-api-middleware` to not make the API call through `[CALL_API].bailout`. You can set this property to a boolean value, and `redux-api-middleware` will bail out if it is `false`: the RSAA will die here, and no FSA will be passed on to the next middleware.
You can tell `redux-api-middleware` to not make the API call through `[CALL_API].bailout`. If the value is `true`, the RSAA will die here, and no FSA will be passed on to the next middleware.

A more useful possibility is to give `[CALL_API].bailout` a function. At runtime, it will be passed the state of your Redux store as its only argument, and the truthiness of its return value will be used to determine whether to make the call or not.
A more useful possibility is to give `[CALL_API].bailout` a function. At runtime, it will be passed the state of your Redux store as its only argument, if the return value of the function is `true`, the API call will not be made.

### Lifecycle

Expand Down

0 comments on commit ea1b399

Please sign in to comment.