pull/15844/head
Rich Harris 2 months ago
parent 16f960eba7
commit 99fa11b4fc

@ -175,8 +175,8 @@ export function pop(component) {
if (effects !== null) { if (effects !== null) {
context.e = null; context.e = null;
for (var effect of effects) { for (var fn of effects) {
create_user_effect(effect.fn); create_user_effect(fn);
} }
} }

@ -200,11 +200,7 @@ export function user_effect(fn) {
if (defer) { if (defer) {
var context = /** @type {ComponentContext} */ (component_context); var context = /** @type {ComponentContext} */ (component_context);
(context.e ??= []).push({ (context.e ??= []).push(fn);
fn,
effect: active_effect,
reaction: active_reaction
});
} else { } else {
return create_user_effect(fn); return create_user_effect(fn);
} }

@ -15,11 +15,7 @@ export type ComponentContext = {
/** context */ /** context */
c: null | Map<unknown, unknown>; c: null | Map<unknown, unknown>;
/** deferred effects */ /** deferred effects */
e: null | Array<{ e: null | Array<() => void | (() => void)>;
fn: () => void | (() => void);
effect: null | Effect;
reaction: null | Reaction;
}>;
/** mounted */ /** mounted */
m: boolean; m: boolean;
/** /**

Loading…
Cancel
Save