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

Function makeDual

packages/effect/src/internal/runtime.ts:30–42  ·  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

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

Callers 1

runtime.tsFile · 0.85

Calls 1

fFunction · 0.50

Tested by

no test coverage detected