/** * Runs `onTrue` if the result of `self` is `true` and `onFalse` otherwise. * * @tsplus static effect/core/stm/STM.Ops ifSTM */ export function ifSTM( b: LazyArg>, onTrue: LazyArg>, onFalse: LazyArg> ): STM { return STM.suspend( b().flatMap( (b): STM => (b ? onTrue() : onFalse()) ) ) }