debug
debug returns a Task that prints state of Tasks, Tags, and Spots to the console — grouped per target. Without it, you’d write that Task by hand and wrap every read in optional:
createTask({ name: "debug", run: { context: { auth: { status: auth.status, result: optional(auth.result), error: optional(auth.error), }, userId: optional(userId.value), }, fn: (ctx) => { console.group("[Task]: auth") console.info(ctx.auth) console.groupEnd() console.group("[Tag]: userId") console.info(ctx.userId) console.groupEnd() }, },})
debug(auth, userId)Console output
Section titled “Console output”▾ [coda] debug ▾ [Task]: auth { status: …, result: …, error: … } ▾ [Tag]: userId …Arguments
Section titled “Arguments”targets — Tasks, Tags, and Spots to inspect. A mix is fine.
Returns
Section titled “Returns”Task — a Task you compose with .step(...).
With options
Section titled “With options”Pass an options object first to set the console group label:
debug(auth, fetchOrder)
debug({ name: "post-login" }, auth, fetchOrder)▾ [coda] debug post-login …Arguments
Section titled “Arguments”options—{ name: string }sets the group label in the console.targets— Tasks, Tags, and Spots to inspect. A mix is fine.
Returns
Section titled “Returns”Task — a Task you compose with .step(...).