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

Function makePrimitiveProto

packages/effect/src/internal/core.ts:388–415  ·  view source on GitHub ↗
(options: {
  readonly op: Op
  readonly [evaluate]?: (
    fiber: FiberImpl
  ) => Primitive | Effect.Effect<any, any, any> | Yield
  readonly [contA]?: (
    this: Primitive,
    value: any,
    fiber: FiberImpl
  ) => Primitive | Effect.Effect<any, any, any> | Yield
  readonly [contE]?: (
    this: Primitive,
    cause: Cause.Cause<any>,
    fiber: FiberImpl
  ) => Primitive | Effect.Effect<any, any, any> | Yield
  readonly [contAll]?: (
    this: Primitive,
    fiber: FiberImpl
  ) => void | ((value: any, fiber: FiberImpl) => void)
})

Source from the content-addressed store, hash-verified

386
387/** @internal */
388export const makePrimitiveProto = <Op extends string>(options: {
389 readonly op: Op
390 readonly [evaluate]?: (
391 fiber: FiberImpl
392 ) => Primitive | Effect.Effect<any, any, any> | Yield
393 readonly [contA]?: (
394 this: Primitive,
395 value: any,
396 fiber: FiberImpl
397 ) => Primitive | Effect.Effect<any, any, any> | Yield
398 readonly [contE]?: (
399 this: Primitive,
400 cause: Cause.Cause<any>,
401 fiber: FiberImpl
402 ) => Primitive | Effect.Effect<any, any, any> | Yield
403 readonly [contAll]?: (
404 this: Primitive,
405 fiber: FiberImpl
406 ) => void | ((value: any, fiber: FiberImpl) => void)
407}): Primitive =>
408 ({
409 ...EffectProto,
410 [identifier]: options.op,
411 [evaluate]: options[evaluate] ?? defaultEvaluate,
412 [contA]: options[contA],
413 [contE]: options[contE],
414 [contAll]: options[contAll]
415 }) as any
416
417/** @internal */
418export const makePrimitive = <

Callers 5

PrototypeFunction · 0.90
effect.tsFile · 0.90
makePrimitiveFunction · 0.85
makeExitFunction · 0.85
core.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected