Summary
The core.Effect constructor has been improved. This ticket tracks the work to update all new Effect() calls across the codebase to use the new, clearer single-object signature: new Effect({ fn: ..., ... }).
Refactoring Targets
src/functional/component/Base.mjs: Update me.vdomEffect in the constructor.
me.vdomEffect = new Effect(() => {
me[hookIndexSymbol] = 0;
me[pendingDomEventsSymbol] = [];
me[vdomToApplySymbol] = me.createVdom(me, me.data)
}, me.id, {
id : me.id,
fn : me.onEffectRunStateChange,
scope: me
});
me.vdomEffect = new Effect({
fn: () => {
me[hookIndexSymbol] = 0;
me[pendingDomEventsSymbol] = [];
me[vdomToApplySymbol] = me.createVdom(me, me.data);
},
componentId: me.id,
subscriber: {
id : me.id,
fn : me.onEffectRunStateChange,
scope: me
}
});
src/state/Provider.mjs: Update effects in afterSetFormulas() and createBinding().
const effect = new Effect(() => { ... }, {lazy: true});
const effect = new Effect({
fn: () => { ... },
lazy: true
});
Acceptance Criteria
- All
new Effect() calls are refactored to use the single config object signature.
- All relevant tests continue to pass.
Summary
The
core.Effectconstructor has been improved. This ticket tracks the work to update allnew Effect()calls across the codebase to use the new, clearer single-object signature:new Effect({ fn: ..., ... }).Refactoring Targets
src/functional/component/Base.mjs: Updateme.vdomEffectin the constructor.// from me.vdomEffect = new Effect(() => { me[hookIndexSymbol] = 0; me[pendingDomEventsSymbol] = []; // Clear pending events for new render me[vdomToApplySymbol] = me.createVdom(me, me.data) }, me.id, { id : me.id, fn : me.onEffectRunStateChange, scope: me }); // to me.vdomEffect = new Effect({ fn: () => { me[hookIndexSymbol] = 0; me[pendingDomEventsSymbol] = []; // Clear pending events for new render me[vdomToApplySymbol] = me.createVdom(me, me.data); }, componentId: me.id, subscriber: { id : me.id, fn : me.onEffectRunStateChange, scope: me } });src/state/Provider.mjs: Update effects inafterSetFormulas()andcreateBinding().// from const effect = new Effect(() => { ... }, {lazy: true}); // to const effect = new Effect({ fn: () => { ... }, lazy: true });Acceptance Criteria
new Effect()calls are refactored to use the single config object signature.