Metakit / @doeixd/metakit

IdempotentCondition

type · packages/metakit/src/ops/ways.ts:78

type IdempotentCondition = 'always' | 'sets-unread' | 'idempotent-operation'

When a write of one way, run twice in a row with the same values, leaves what it left once:

  • always;
  • sets-unread: no value it sets reads a field it sets (a toggle, which sets a field from itself, is not once twice);
  • idempotent-operation: a combine whose operation claims idempotent and total associative: true.

All hold of a write whose values read no path the transition writes; a value that does is Pairs.idempotent's to refuse, not the way's.