Effect CommunityEC
Effect Community3y ago
42 replies
iamK

Avoiding 'NoSuchElementException' in a TypeScript code snippet

Hi

how to avoid 'NoSuchElementException' here ?

pipe(
Effect.succeed([]),
Effect.flatMap(arr => arr.length > 0 ? Option.some('value') : Option.none()),
)
Was this page helpful?