Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add callbacks onSuccess and onError #11

Merged
merged 8 commits into from
Aug 9, 2022

Conversation

edumudu
Copy link
Owner

@edumudu edumudu commented Aug 9, 2022

Add two more options globals and per hook

  • onSuccess(data, key, config) - called when the fetcher call successed
  • onError(err, key, config) - called when the fetcher throws

When pass an global one and one in the hook, both will be called

@edumudu edumudu added the enhancement New feature or request label Aug 9, 2022
@edumudu edumudu self-assigned this Aug 9, 2022
@edumudu edumudu merged commit caefe9b into release/v1.5.0 Aug 9, 2022
@edumudu edumudu deleted the feat/add-callbacks branch August 9, 2022 01:49
edumudu pushed a commit that referenced this pull request Aug 9, 2022
# [1.5.0](v1.4.0...v1.5.0) (2022-08-09)

### Features

* add `fallbackData` option ([#12](#12)) ([708b7c6](708b7c6))
* add event callbacks onSuccess and onError ([#11](#11)) ([caefe9b](caefe9b))
@github-actions
Copy link

github-actions bot commented Aug 9, 2022

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant