diff --git a/packages/compiler/src/compiler/codegen.ts b/packages/compiler/src/compiler/codegen.ts index fc7f9d1..6545ea9 100644 --- a/packages/compiler/src/compiler/codegen.ts +++ b/packages/compiler/src/compiler/codegen.ts @@ -199,7 +199,7 @@ ${joinItems(sa.captureBinders.map(binderTypeGuard(ctx, t)), '\n')} x(ctx.parser.eventHandlerEndpointStatement, (s, t) => { if (s.triggerType === 'dataflow') { - return t`dataflow { if (${walk(s.predicate)}) { ${terminalWrap(t, s.terminal, walk(s.body))} } }`; + return t`__SYNDICATE__.Turn.active._dataflow(() => { if (${walk(s.predicate)}) { ${terminalWrap(t, s.terminal, walk(s.body))} } });`; } if (s.triggerType === 'stop') {