Function latch

    • Latch a predicate. Holds at init until pred is observed !init within scope, then flips and stays; re-arms on each scope rising edge. Outside scope, pred isn't consulted (latch holds).

      Parameters

      • pred: Read<boolean>
      • init: boolean
      • scope: Read<boolean> = ALWAYS_TRUE

      Returns Read<boolean>