Skip to content

Function any()

any<T, V, E>(items: T[], callback: (item: T) => Result<V, E>, fallback: Result<V, E>): Result<V, E>

Source: result.ts

Returns the first Result.Success produced by the callback for any item in the collection. If no success is found, it returns the provided default error Result. Similar to PromiseConstructor.any, but for synchronous Result collections.

Type Parameters

T

T

V

V

E

E

Parameters

items

T[]

callback

(item: T) => Result<V, E>

fallback

Result<V, E>

Returns

Result<V, E>

Built by Prozilla