Skip to content

Commit

Permalink
Fix use done tracker subscription triggering
Browse files Browse the repository at this point in the history
hansottowirtz committed Sep 22, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
hansottowirtz Hans Otto Wirtz
1 parent c1eb162 commit 2ce82e7
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
1 change: 0 additions & 1 deletion src/use-done-tracker-subscription.ts
Original file line number Diff line number Diff line change
@@ -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]);

1 comment on commit 2ce82e7

@vercel
Copy link

@vercel vercel bot commented on 2ce82e7 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.