MCPcopy Create free account
hub / github.com/Effect-TS/effect / make

Function make

packages/effect/src/unstable/cluster/Singleton.ts:46–56  ·  view source on GitHub ↗
(
  name: string,
  run: Effect.Effect<void, E, R>,
  options?: {
    readonly shardGroup?: string | undefined
  }
)

Source from the content-addressed store, hash-verified

44 * @since 4.0.0
45 */
46export const make = <E, R>(
47 name: string,
48 run: Effect.Effect<void, E, R>,
49 options?: {
50 readonly shardGroup?: string | undefined
51 }
52): Layer.Layer<never, never, Sharding | Exclude<R, Scope>> =>
53 Layer.effectDiscard(Effect.gen(function*() {
54 const sharding = yield* Sharding
55 yield* sharding.registerSingleton(name, run, options)
56 }))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected