Skip to content

Commit

Permalink
fix(core): withoutHooks will correctly restore hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-thebaud committed Jan 29, 2024
1 parent 821008b commit 780aeeb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/core/src/hooks/withoutHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ export default function withoutHooks<T extends Hookable<any>, R>(

return new Promise((resolve, reject) => {
value
.then((v) => resolve(v))
.catch((e) => reject(e))
.finally(() => {
.then((v) => {
hookable.$hooks = hooksBackup;
resolve(v);
})
.catch((e) => {
hookable.$hooks = hooksBackup;
reject(e);
});
}) as any;
}
Expand Down

0 comments on commit 780aeeb

Please sign in to comment.