/** * Returns an effect that, if evaluated, will return the cached result of this * effect. Cached results will expire after `timeToLive` duration. * * @tsplus static effect/core/io/Effect.Aspects cached * @tsplus pipeable effect/core/io/Effect cached */ export function cached(timeToLive: Duration) { return (self: Effect): Effect> => self.cachedInvalidate(timeToLive).map((tuple) => tuple[0]) }