Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
feat(handleFetching): return result of 'run()' hook
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysova committed May 29, 2018
1 parent 1d4cc63 commit b955ade
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ const handleFetching = (actions, fetcher) => (
}

try {
await fetcher.run(dispatch, getState, extra, beforeResult)
const result = await fetcher.run(dispatch, getState, extra, beforeResult)

dispatch(actions.finish())
return result
}
catch (error) {
if (fetcher.fail) {
Expand All @@ -81,6 +83,7 @@ const handleFetching = (actions, fetcher) => (
else {
dispatch(actions.fail(error))
}
return undefined
}
}
)
Expand Down

0 comments on commit b955ade

Please sign in to comment.