Effect, one function at a time
Six short lessons, one Effect function each, in the order I would teach them to a colleague.
Each lesson covers one function from Effect and shows it in a small TypeScript snippet. Read them in order; each one assumes the ones before it.
Lessons
- 01Sequence steps with Effect.gen
Write sequential Effect code with yield*.
- 02Wrap a promise with Effect.tryPromise
Turn a promise that can fail into an Effect.
- 03Recover one error with Effect.catchTag
Recover from one tagged error and leave the others alone.
- 04Feed a layer with Layer.provide
Feed one layer's output into another layer.
- 05Stop waiting with Effect.timeout
Stop waiting after a deadline.
- 06Try again with Effect.retry
Run the effect again after a failure.