ErrorsBackground work · rule
event.emit_invalid
Emit is given something that isn't an event, or is used outside an action.
Area 12, Background work; not declinable; the next step is usually the agent's.
Only an action emits, and only an event; a function emits by calling an action:
type Note = Text { max_length: 200}type NoteSeen = Event { note: Note}function seen(note: Note) -> NoteSeen { emit NoteSeen { note: note } return NoteSeen { note: note }}
error A function can't emit NoteSeen
--> main.jadpo:10:5
|10 | emit NoteSeen { | ^^^^^^^^^^^^^^^ only actions emit
- reason
- An event is kept in the same transaction as an action's writes and handed to its subscribers once it commits, so only actions emit; a function emits by calling an action.
- next
- Move the
emitinto the action this code calls, or make this an action (agent) - rule
- event.
emit_ invalid - help
- https://jadpo.
dev/docs/errors/event. emit_ invalid
Markdown for agents: /docs/errors/event.emit_invalid.md.Built from Jadpo main at aee2e8f.