Skip to content

chain

chain<E, A, B>(f): (data) => RemoteData<E, B>

Defined in: Core/RemoteData.ts:114

Chains RemoteData computations. If the input is Success, passes the value to f. Otherwise, propagates the current state.

E

A

B

(a) => RemoteData<E, B>

(data) => RemoteData<E, B>

pipe(
  RemoteData.make.success(5),
  RemoteData.chain(n => n > 0 ? RemoteData.make.success(n) : RemoteData.make.failure("negative"))
);