Skip to main content
customers.rename reads the customer and its observed account, records the requested name and submits one renameCustomer task. The writes and the task commit together, or not at all.
bijection/customers.ts
  • ctx.refuse returns never, so the code after each check sees the narrowed fact.
  • ctx.patch assumes the customer is present. That assumption joins the transaction’s read set: if the fact is gone at commit, the transaction refuses Absent.
  • ctx.submit(target, args, { once, then }) commits intent toward the target atomically with the writes and returns a Task. The host performs it after the commit.
once is the identity of this one logical effect. It names the customer, the account revision read and the name, so asking again for the same name at the same revision returns the original task and sends nothing more. The CRM applies the change only to the revision this transaction read (If-Match). then: renamed.with({ … }) names the continuation: the mutation that receives the task’s result. Effects covers targets, submit and continuations. Continue to observe the result.