Skip to content

Instantly share code, notes, and snippets.

@behnamazimi
Created June 2, 2020 18:20
Show Gist options
  • Save behnamazimi/245e6b60d1ed5ca574c70b4417f54ced to your computer and use it in GitHub Desktop.
Save behnamazimi/245e6b60d1ed5ca574c70b4417f54ced to your computer and use it in GitHub Desktop.
ServiceWrapper.setHook.js
ServiceWrapper
// get result and return the data property
.setHook(HOOKS.BEFORE_RESOLVE, res => res.data)
// this method will call on all successes.
.setHook(HOOKS.AFTER_SUCCESS, res => {
console.log(res);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment