Tide · API

tide.load

tide.load loads the reflexes Tide runs from then on. It parses each reflex, validates the set as a whole and returns a report; a host calls it again to change what runs. blind lists each reflex whose effect handler declares no writes, so Tide cannot determine which reflexes it may trigger.

Reflexes
[
  {
    id: 'billing.charge',
    intent: 'Charge every season pass on the first of the month.',
    on: {
      clock: {
        every: 'month',
        on: 1,
        at: '03:00',
        tz: 'Europe/Vienna',
      },
    },
    select: {
      query: { table: 'passes' },
      mode: 'each',
      unitKey: 'member',
    },
    effect: {
      name: 'payments.charge',
      input: {
        member: { $ref: '$.row.member' },
        amount: { $ref: '$.row.amount_cents' },
      },
    },
  },
  {
    id: 'billing.receipt',
    intent: 'Send a receipt when a charge goes through.',
    on: { fact: { entity: 'charges', op: 'insert' } },
    effect: {
      name: 'mail.send',
      input: { to: { $ref: '$.row.member' }, kind: 'receipt' },
    },
  },
]
Declared writes per effect
[
  { effect: 'payments.charge', writes: ['charges'] },
  { effect: 'mail.send', writes: 'not declared' },
]
Report
{
  loaded: 2,
  cycles: [],
  blind: [{ reflexId: 'billing.receipt', effect: 'mail.send' }],
  warnings: [],
}
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.