MCPcopy
hub / github.com/Effect-TS/effect / makeDual

Function makeDual

packages/effect/src/internal/runtime.ts:29–41  ·  view source on GitHub ↗
(
  f: (runtime: Runtime.Runtime<never>, effect: Effect.Effect<any, any>, ...args: Args) => Return
)

Source from the content-addressed store, hash-verified

27import * as supervisor_ from "./supervisor.js"
28
29const makeDual = <Args extends Array<any>, Return>(
30 f: (runtime: Runtime.Runtime<never>, effect: Effect.Effect<any, any>, ...args: Args) => Return
31): {
32 <R>(runtime: Runtime.Runtime<R>): <A, E>(effect: Effect.Effect<A, E, R>, ...args: Args) => Return
33 <R, A, E>(runtime: Runtime.Runtime<R>, effect: Effect.Effect<A, E, R>, ...args: Args): Return
34} =>
35 function(this: any) {
36 if (arguments.length === 1) {
37 const runtime = arguments[0]
38 return (effect: any, ...args: Args) => f(runtime, effect, ...args)
39 }
40 return f.apply(this, arguments as any)
41 } as any
42
43/** @internal */
44export const unsafeFork: {

Callers 1

runtime.tsFile · 0.85

Calls 1

fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…