MCPcopy Create free account
hub / github.com/Effect-TS/effect / when

Method when

packages/effect/src/unstable/reactivity/AsyncResult.ts:822–833  ·  view source on GitHub ↗
(
    refinement: Predicate<AsyncResult<A, E>>,
    f: (result: AsyncResult<A, E>) => Option.Option<C>
  )

Source from the content-addressed store, hash-verified

820 f: (result: AsyncResult<A, E>) => Option.Option<C>
821 ): any
822 when<C>(
823 refinement: Predicate<AsyncResult<A, E>>,
824 f: (result: AsyncResult<A, E>) => Option.Option<C>
825 ): any {
826 if (Option.isNone(this.output) && refinement(this.result)) {
827 const b = f(this.result)
828 if (Option.isSome(b)) {
829 ;(this as any).output = b
830 }
831 }
832 return this
833 }
834
835 pipe() {
836 return pipeArguments(this, arguments)

Callers 15

onWaitingMethod · 0.95
onInitialOrWaitingMethod · 0.95
onInitialMethod · 0.95
onSuccessMethod · 0.95
onFailureMethod · 0.95
onErrorIfMethod · 0.95
onDefectMethod · 0.95
onInterruptMethod · 0.95
Match.test.tsFile · 0.80
Stream.test.tsFile · 0.80
shutdownFunction · 0.80
unsubscribeFunction · 0.80

Calls 1

fFunction · 0.50

Tested by

no test coverage detected