diff --git a/packages/compiler/src/compiler/codegen.ts b/packages/compiler/src/compiler/codegen.ts index 7290fff..6f0ce10 100644 --- a/packages/compiler/src/compiler/codegen.ts +++ b/packages/compiler/src/compiler/codegen.ts @@ -198,13 +198,12 @@ export function expand(tree: Items, ctx: ExpansionContext): Items { } else { // TODO: untyped template const sa = compilePattern(s.pattern); - const body = ctx.withCollectedFields(s.facetFields, () => walk(s.body)); return t`withSelfDo(function (thisFacet) { const _Facets = new __SYNDICATE__.Dictionary<__SYNDICATE__.Facet>(); on asserted ${patternText(s.pattern)} => react { _Facets.set([${commaJoin(sa.captureBinders.map(t=>[t.id]))}], thisFacet); dataflow { } // TODO: horrible hack to keep the facet alive if no other endpoints - ${body} + ${s.body} } on retracted ${patternText(s.pattern)} => { const _Key = [${commaJoin(sa.captureBinders.map(t=>[t.id]))}];