import { Effect, Schedule } from "effect";
const response =
Effect.tryPromise(() =>
fetch("https://arr")
).pipe(
Effect.repeat({
until: _ => _.ok,
times: 3,
schedule: Schedule.exponential("1 second")
}),
Effect.andThen(_ => _.json() ) // _ == Duration ???
)
import { Effect, Schedule } from "effect";
const response =
Effect.tryPromise(() =>
fetch("https://arr")
).pipe(
Effect.repeat({
until: _ => _.ok,
times: 3,
schedule: Schedule.exponential("1 second")
}),
Effect.andThen(_ => _.json() ) // _ == Duration ???
)