From 2ce82e736c6464dca36430896f7f0f0cb1428d4b Mon Sep 17 00:00:00 2001 From: Hans Otto Wirtz Date: Fri, 22 Sep 2023 19:22:00 +0200 Subject: [PATCH] Fix use done tracker subscription triggering --- package.json | 2 +- src/use-done-tracker-subscription.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 59df4f4..f27681b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-done-tracker", - "version": "0.0.13", + "version": "0.0.14", "description": "Keep track of when your React tree is done loading", "type": "module", "main": "./dist/index.js", diff --git a/src/use-done-tracker-subscription.ts b/src/use-done-tracker-subscription.ts index 01f6452..eaf0e1b 100644 --- a/src/use-done-tracker-subscription.ts +++ b/src/use-done-tracker-subscription.ts @@ -40,7 +40,6 @@ export const useDoneTrackerSubscription = ( useEffect(() => { if (!done) return; const fn = () => done(); - if (doneTracker.done) done(); doneTracker.addEventListener("done", fn); return () => doneTracker.removeEventListener("done", fn); }, [doneTracker, done]);