import * as tsplus_module_1 from "@effect/core/io/Effect/operations/cachedInvalidate";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/map";
/**
 * Returns an effect that, if evaluated, will return the cached result of this
 * effect. Cached results will expire after `timeToLive` duration.
 *
 * @tsplus fluent ets/Effect cached
 */

export function cached_(self, timeToLive, __tsplusTrace) {
  return tsplus_module_2.map_(tsplus_module_1.cachedInvalidate_(self, timeToLive, __tsplusTrace), tuple => tuple.get(0), __tsplusTrace);
}
/**
 * Returns an effect that, if evaluated, will return the cached result of this
 * effect. Cached results will expire after `timeToLive` duration.
 *
 * @tsplus static ets/Effect/Aspects cached
 */

export const cached = (timeToLive, __tsplusTrace) => self => cached_(self, timeToLive, __tsplusTrace);
//# sourceMappingURL=cached.mjs.map