Skip to content

Commit

Permalink
change call to apply to pass this context to custom apiClient impleme…
Browse files Browse the repository at this point in the history
…ntations
  • Loading branch information
devvmh committed Aug 8, 2016
1 parent 79f6208 commit 3d84600
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function* _apiGeneric(action: CrudAction<any>): Generator<Effect, void, any> {
}

try {
const response = yield call(apiClient[method], path, { params, data, fetchConfig })
const response = yield call([apiClient, apiClient[method]], path, { params, data, fetchConfig })
yield put({ meta, type: success, payload: response })
} catch (error) {
yield put({ meta, type: failure, payload: error, error: true })
Expand Down
2 changes: 1 addition & 1 deletion test/sagas.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('apiGeneric', () => {
const gen = apiGeneric(apiClient)(fetchWidgets(1))
const apiCall = gen.next().value
expect(apiCall).toEqual(
call(apiClient.get, '/widgets', {
call([apiClient, apiClient.get], '/widgets', {
params: { page: 1 },
data: undefined,
fetchConfig: undefined
Expand Down

0 comments on commit 3d84600

Please sign in to comment.