Comparing version 1.0.0 to 1.0.1
@@ -33,2 +33,3 @@ import EventEmitter from 'eventemitter3'; | ||
useEffect(() => { | ||
let mounted = true; | ||
async function innerFn() { | ||
@@ -42,2 +43,5 @@ try { | ||
} | ||
if (!mounted) { | ||
return; | ||
} | ||
if (fnRef.current) { | ||
@@ -49,2 +53,5 @@ return void fnRef.current(discard); | ||
innerFn(); | ||
return () => { | ||
mounted = false; | ||
}; | ||
}, [discard, promise]); | ||
@@ -51,0 +58,0 @@ } |
{ | ||
"name": "toasterhea", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Promise-driven toast poppin' library.", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"types": "./index.d.ts", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
16062
418