Skip to content

Commit

Permalink
Merge pull request reduxjs#617 from dbrans/patch-1
Browse files Browse the repository at this point in the history
real-world example - bailout isn't used.
  • Loading branch information
gaearon committed Aug 24, 2015
2 parents 397fb5e + 18b5134 commit 6e0fb45
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions examples/real-world/middleware/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default store => next => action => {
}

let { endpoint } = callAPI;
const { schema, types, bailout } = callAPI;
const { schema, types } = callAPI;

if (typeof endpoint === 'function') {
endpoint = endpoint(store.getState());
Expand All @@ -112,13 +112,6 @@ export default store => next => action => {
if (!types.every(type => typeof type === 'string')) {
throw new Error('Expected action types to be strings.');
}
if (typeof bailout !== 'undefined' && typeof bailout !== 'function') {
throw new Error('Expected bailout to either be undefined or a function.');
}

if (bailout && bailout(store.getState())) {
return Promise.resolve();
}

function actionWith(data) {
const finalAction = Object.assign({}, action, data);
Expand Down

0 comments on commit 6e0fb45

Please sign in to comment.