effect-io-ai

Package: effect
Module: STM

STM.firstSuccessOf

This function takes an iterable of STM values and returns a new STM value that represents the first STM value in the iterable that succeeds. If all of the Effect values in the iterable fail, then the resulting STM value will fail as well.

This function is sequential, meaning that the STM values in the iterable will be executed in sequence, and the first one that succeeds will determine the outcome of the resulting STM value.

Returns a new STM value that represents the first successful STM value in the iterable, or a failed STM value if all of the STM values in the iterable fail.

Signature

declare const firstSuccessOf: <A, E, R>(effects: Iterable<STM<A, E, R>>) => STM<A, E, R>

Source

Since v2.0.0