location-layer.ts 531 B

12345678910111213
  1. import { Layer, LayerMap } from "effect"
  2. import { Location } from "./location"
  3. import { Catalog } from "./catalog"
  4. import { PluginBoot } from "./plugin/boot"
  5. export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()("@opencode/example/LocationServiceMap", {
  6. lookup: (ref: Location.Ref) =>
  7. Layer.mergeAll(Catalog.defaultLayer, PluginBoot.defaultLayer).pipe(
  8. Layer.provide([Layer.succeed(Location.Service, Location.Service.of(ref))]),
  9. ),
  10. idleTimeToLive: "5 minutes",
  11. dependencies: [],
  12. }) {}