Skip to content

Commit

Permalink
Update api.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrans committed Aug 24, 2015
1 parent 397fb5e commit 18b5134
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 18b5134

Please sign in to comment.