): void;
diff --git a/src/leaf-done-tracker.ts b/src/leaf-done-tracker.ts
index 64f5fec..f35b58d 100644
--- a/src/leaf-done-tracker.ts
+++ b/src/leaf-done-tracker.ts
@@ -16,8 +16,6 @@ export class LeafDoneTracker extends BaseDoneTracker implements DoneTracker {
private _erroredAt: number | null = null;
private _pendingAt: number = performance.now();
- public preventChangePropagation = false;
-
get id() {
return this._name ? `${this._id}:${this._name}` : this._id;
}
@@ -127,19 +125,6 @@ export class LeafDoneTracker extends BaseDoneTracker implements DoneTracker {
this.dispatchEvent("error", err, this);
};
- signalChange = () => {
- if (this.aborted) {
- warn("Already aborted, can't signal change", this.id);
- return;
- }
- if (!this.done) {
- debug("Not done, not signaling change", this.id);
- return;
- }
- log("🌀 Signaling changed", this.id, "after");
- this.dispatchEvent("change");
- };
-
reset = () => {
if (this.aborted) {
warn("Already aborted, can't repend", this.id);
diff --git a/src/node-done-tracker.ts b/src/node-done-tracker.ts
index d816779..c1ae9a3 100644
--- a/src/node-done-tracker.ts
+++ b/src/node-done-tracker.ts
@@ -24,8 +24,6 @@ export class NodeDoneTracker extends BaseDoneTracker implements DoneTracker {
private _erroredAt: number | null = null;
private _pendingAt: number = performance.now();
- public preventChangePropagation = false;
-
get id() {
return this._name ? `${this._id}:${this._name}` : this._id;
}
@@ -131,15 +129,6 @@ export class NodeDoneTracker extends BaseDoneTracker implements DoneTracker {
if (!canReset) return;
this.reset();
});
- if (!child.preventChangePropagation) {
- child.addEventListener("change", () => {
- debug("Child of", this.id, "changed");
- if (!this.done) return;
- // needs to be available for useDoneTrackerSubscription
- this.dispatchEvent("change");
- });
- }
-
if (child.done) {
debug("Child was already done when added", child.id);
this.checkAndDispatchState();
diff --git a/src/stories/AsyncTree.stories.tsx b/src/stories/AsyncTree.stories.tsx
index d670692..34d24cf 100644
--- a/src/stories/AsyncTree.stories.tsx
+++ b/src/stories/AsyncTree.stories.tsx
@@ -41,7 +41,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/Button.stories.tsx b/src/stories/Button.stories.tsx
index 0b6e954..9773bd8 100644
--- a/src/stories/Button.stories.tsx
+++ b/src/stories/Button.stories.tsx
@@ -14,7 +14,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/DelayedContainer.stories.tsx b/src/stories/DelayedContainer.stories.tsx
index 6f49090..4cf449e 100644
--- a/src/stories/DelayedContainer.stories.tsx
+++ b/src/stories/DelayedContainer.stories.tsx
@@ -16,7 +16,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
};
diff --git a/src/stories/DelayedContainerAndChildren.stories.tsx b/src/stories/DelayedContainerAndChildren.stories.tsx
index 8205846..74db187 100644
--- a/src/stories/DelayedContainerAndChildren.stories.tsx
+++ b/src/stories/DelayedContainerAndChildren.stories.tsx
@@ -24,7 +24,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/EmptyNode.stories.tsx b/src/stories/EmptyNode.stories.tsx
index d3b0d1b..4a0237f 100644
--- a/src/stories/EmptyNode.stories.tsx
+++ b/src/stories/EmptyNode.stories.tsx
@@ -19,7 +19,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
const Tree = () => {
diff --git a/src/stories/Image.stories.tsx b/src/stories/Image.stories.tsx
index 13bc304..7aa9e53 100644
--- a/src/stories/Image.stories.tsx
+++ b/src/stories/Image.stories.tsx
@@ -15,7 +15,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/ImmediatelyDone.stories.tsx b/src/stories/ImmediatelyDone.stories.tsx
index 26db4b5..107e390 100644
--- a/src/stories/ImmediatelyDone.stories.tsx
+++ b/src/stories/ImmediatelyDone.stories.tsx
@@ -30,7 +30,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/ImmediatelyDoneWithChildren.stories.tsx b/src/stories/ImmediatelyDoneWithChildren.stories.tsx
index b3832e6..caa973c 100644
--- a/src/stories/ImmediatelyDoneWithChildren.stories.tsx
+++ b/src/stories/ImmediatelyDoneWithChildren.stories.tsx
@@ -24,7 +24,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/ImmediatelyErroring.stories.tsx b/src/stories/ImmediatelyErroring.stories.tsx
index c1e2a47..42770f5 100644
--- a/src/stories/ImmediatelyErroring.stories.tsx
+++ b/src/stories/ImmediatelyErroring.stories.tsx
@@ -30,7 +30,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/ImperativeAsyncTree.stories.tsx b/src/stories/ImperativeAsyncTree.stories.tsx
index 343b3f0..2669e69 100644
--- a/src/stories/ImperativeAsyncTree.stories.tsx
+++ b/src/stories/ImperativeAsyncTree.stories.tsx
@@ -54,7 +54,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/ImperativeAsyncTree2.stories.tsx b/src/stories/ImperativeAsyncTree2.stories.tsx
index eefe789..6416bf0 100644
--- a/src/stories/ImperativeAsyncTree2.stories.tsx
+++ b/src/stories/ImperativeAsyncTree2.stories.tsx
@@ -115,7 +115,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/ImperativeAsyncTree3.stories.tsx b/src/stories/ImperativeAsyncTree3.stories.tsx
index e788442..ad0ef15 100644
--- a/src/stories/ImperativeAsyncTree3.stories.tsx
+++ b/src/stories/ImperativeAsyncTree3.stories.tsx
@@ -55,7 +55,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/ImperativeButton.stories.tsx b/src/stories/ImperativeButton.stories.tsx
index 3138645..200fe72 100644
--- a/src/stories/ImperativeButton.stories.tsx
+++ b/src/stories/ImperativeButton.stories.tsx
@@ -12,7 +12,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/ImperativeImage.stories.tsx b/src/stories/ImperativeImage.stories.tsx
index a2e422f..9fc589e 100644
--- a/src/stories/ImperativeImage.stories.tsx
+++ b/src/stories/ImperativeImage.stories.tsx
@@ -13,7 +13,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/ImperativeInput.stories.tsx b/src/stories/ImperativeInput.stories.tsx
index ecb5a16..265b4ba 100644
--- a/src/stories/ImperativeInput.stories.tsx
+++ b/src/stories/ImperativeInput.stories.tsx
@@ -40,7 +40,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/ImperativeRecursiveTree.stories.tsx b/src/stories/ImperativeRecursiveTree.stories.tsx
index 3b5a911..0e78519 100644
--- a/src/stories/ImperativeRecursiveTree.stories.tsx
+++ b/src/stories/ImperativeRecursiveTree.stories.tsx
@@ -99,7 +99,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/ImperativeSimpleAsyncTree.stories.tsx b/src/stories/ImperativeSimpleAsyncTree.stories.tsx
index 90ee0e9..b30e63e 100644
--- a/src/stories/ImperativeSimpleAsyncTree.stories.tsx
+++ b/src/stories/ImperativeSimpleAsyncTree.stories.tsx
@@ -43,7 +43,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/Intro.mdx b/src/stories/Intro.mdx
index 2feb009..d77a333 100644
--- a/src/stories/Intro.mdx
+++ b/src/stories/Intro.mdx
@@ -37,7 +37,6 @@ export const actions = {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
};
# React Done Tracker
diff --git a/src/stories/Intro.stories.tsx b/src/stories/Intro.stories.tsx
index c25efe5..c9e9e3e 100644
--- a/src/stories/Intro.stories.tsx
+++ b/src/stories/Intro.stories.tsx
@@ -29,7 +29,6 @@ const actions = {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
};
const VisualizedDelayedComponent = visualizeDoneWrapper(DelayedComponent);
diff --git a/src/stories/MixedUsage.stories.tsx b/src/stories/MixedUsage.stories.tsx
index 80ccc02..a60b20a 100644
--- a/src/stories/MixedUsage.stories.tsx
+++ b/src/stories/MixedUsage.stories.tsx
@@ -111,7 +111,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/NestedTrackDone.stories.tsx b/src/stories/NestedTrackDone.stories.tsx
index a75913f..f6d51bc 100644
--- a/src/stories/NestedTrackDone.stories.tsx
+++ b/src/stories/NestedTrackDone.stories.tsx
@@ -39,7 +39,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/PropDelayer.stories.tsx b/src/stories/PropDelayer.stories.tsx
index 5e23257..dd739f3 100644
--- a/src/stories/PropDelayer.stories.tsx
+++ b/src/stories/PropDelayer.stories.tsx
@@ -61,7 +61,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/PropDelayerNoSubtree.stories.tsx b/src/stories/PropDelayerNoSubtree.stories.tsx
index 30ad726..bd96e2d 100644
--- a/src/stories/PropDelayerNoSubtree.stories.tsx
+++ b/src/stories/PropDelayerNoSubtree.stories.tsx
@@ -52,7 +52,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/RecursiveTree.stories.tsx b/src/stories/RecursiveTree.stories.tsx
index e11a8f6..71af71e 100644
--- a/src/stories/RecursiveTree.stories.tsx
+++ b/src/stories/RecursiveTree.stories.tsx
@@ -82,7 +82,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/Rerendering.stories.tsx b/src/stories/Rerendering.stories.tsx
index 3bf8562..29e8356 100644
--- a/src/stories/Rerendering.stories.tsx
+++ b/src/stories/Rerendering.stories.tsx
@@ -50,7 +50,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/Reset.stories.tsx b/src/stories/Reset.stories.tsx
index f9b3c95..3b1c643 100644
--- a/src/stories/Reset.stories.tsx
+++ b/src/stories/Reset.stories.tsx
@@ -15,7 +15,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
const ForkNodeDoneTracker = imperativeToContextual(
diff --git a/src/stories/SimpleAsyncTree.stories.tsx b/src/stories/SimpleAsyncTree.stories.tsx
index eac4082..1fc5121 100644
--- a/src/stories/SimpleAsyncTree.stories.tsx
+++ b/src/stories/SimpleAsyncTree.stories.tsx
@@ -41,7 +41,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/SlowHook.stories.tsx b/src/stories/SlowHook.stories.tsx
index fb8c01b..91984a9 100644
--- a/src/stories/SlowHook.stories.tsx
+++ b/src/stories/SlowHook.stories.tsx
@@ -10,7 +10,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/SlowHookFixed.stories.tsx b/src/stories/SlowHookFixed.stories.tsx
index 7a784b8..61760ea 100644
--- a/src/stories/SlowHookFixed.stories.tsx
+++ b/src/stories/SlowHookFixed.stories.tsx
@@ -10,7 +10,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/SlowHookFixedWithDelay.stories.tsx b/src/stories/SlowHookFixedWithDelay.stories.tsx
index 613157c..bc6f283 100644
--- a/src/stories/SlowHookFixedWithDelay.stories.tsx
+++ b/src/stories/SlowHookFixedWithDelay.stories.tsx
@@ -10,7 +10,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/SlowHookFixedWithEffectsDelay.stories.tsx b/src/stories/SlowHookFixedWithEffectsDelay.stories.tsx
index 823065d..f8ce3aa 100644
--- a/src/stories/SlowHookFixedWithEffectsDelay.stories.tsx
+++ b/src/stories/SlowHookFixedWithEffectsDelay.stories.tsx
@@ -10,7 +10,6 @@ const { actions, actionsMockClear } = createSpyableActions({
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
});
export default {
diff --git a/src/stories/StoryWrapper.tsx b/src/stories/StoryWrapper.tsx
index b1dbe2b..916c809 100644
--- a/src/stories/StoryWrapper.tsx
+++ b/src/stories/StoryWrapper.tsx
@@ -24,7 +24,6 @@ export default function StoryWrapper(props: StoryWrapperProps) {
onAbort,
onError,
onPending,
- onChange,
disableStrictMode,
recreateDoneTrackerOnPropsChange,
hideForceRefresh,
@@ -115,11 +114,6 @@ export default function StoryWrapper(props: StoryWrapperProps) {
onPending?.();
setStatus("pending");
}, [onPending])}
- onChange={useCallback(() => {
- console.log("Story wrapper status", "change");
- onChange?.();
- setStatus("done");
- }, [onChange])}
>
{children}
diff --git a/src/stories/Suspense.stories.tsx b/src/stories/Suspense.stories.tsx
index 14ee88d..de927aa 100644
--- a/src/stories/Suspense.stories.tsx
+++ b/src/stories/Suspense.stories.tsx
@@ -44,7 +44,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/UsingSkip.stories.tsx b/src/stories/UsingSkip.stories.tsx
index 28add1a..d02c323 100644
--- a/src/stories/UsingSkip.stories.tsx
+++ b/src/stories/UsingSkip.stories.tsx
@@ -50,7 +50,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/stories/VeryDeep.stories.tsx b/src/stories/VeryDeep.stories.tsx
index a3f8bf1..6c50c53 100644
--- a/src/stories/VeryDeep.stories.tsx
+++ b/src/stories/VeryDeep.stories.tsx
@@ -43,7 +43,6 @@ export default {
onAbort: action("abort"),
onError: action("error"),
onPending: action("pending"),
- onChange: action("change"),
}),
],
} as Meta;
diff --git a/src/track-component-done.tsx b/src/track-component-done.tsx
index 361d0a6..82f4eaf 100644
--- a/src/track-component-done.tsx
+++ b/src/track-component-done.tsx
@@ -5,5 +5,4 @@ export type TrackComponentDoneProps = {
onAbort?: () => void;
onError?: (err: any, source: DoneTracker) => void;
onPending?: () => void;
- onChange?: () => void;
-} & Omit
;
+} & Omit
;
diff --git a/src/use-done-tracker-subscription.ts b/src/use-done-tracker-subscription.ts
index 8ad047a..eaf0e1b 100644
--- a/src/use-done-tracker-subscription.ts
+++ b/src/use-done-tracker-subscription.ts
@@ -8,12 +8,10 @@ export const useDoneTrackerSubscription = (
done,
error,
pending,
- change,
}: {
done?: () => void;
error?: (err: any, source: DoneTracker) => void;
pending?: () => void;
- change?: () => void;
}
) => {
useEffect(() => {
@@ -60,11 +58,4 @@ export const useDoneTrackerSubscription = (
doneTracker.addEventListener("reset", fn);
return () => doneTracker.removeEventListener("reset", fn);
}, [doneTracker, pending]);
-
- useEffect(() => {
- if (!change) return;
- const fn = () => change();
- doneTracker.addEventListener("change", fn);
- return () => doneTracker.removeEventListener("change", fn);
- }, [doneTracker, change]);
};
diff --git a/src/use-imperative-node-done-tracker.ts b/src/use-imperative-node-done-tracker.ts
index e565db7..6c9b72d 100644
--- a/src/use-imperative-node-done-tracker.ts
+++ b/src/use-imperative-node-done-tracker.ts
@@ -8,7 +8,6 @@ export const useImperativeNodeDoneTracker = (
{
name,
skip = false,
- preventChangePropagation = false
}: {
name?: string;
/**
@@ -20,7 +19,6 @@ export const useImperativeNodeDoneTracker = (
* When the children are rendered/registered, change it to false.
*/
skip?: boolean;
- preventChangePropagation?: boolean;
} = {}
) => {
if (!doneTracker)
@@ -29,7 +27,6 @@ export const useImperativeNodeDoneTracker = (
);
const localDoneTracker = useDoneTrackerRaw(doneTracker, "node", name);
- if (preventChangePropagation) localDoneTracker.preventChangePropagation = true;
useTemporarilySkipNodeDoneTracker(localDoneTracker, skip);
// uncomment when we want to