(fn: (...args: Args) => Result)
| 25 | } |
| 26 | |
| 27 | export const bind = <Args extends readonly unknown[], Result>(fn: (...args: Args) => Result) => { |
| 28 | const captured = captureSync() |
| 29 | return (...args: Args) => |
| 30 | restoreWorkspace(captured.workspace, () => |
| 31 | Effect.runSync( |
| 32 | attachWith( |
| 33 | Effect.sync(() => fn(...args)), |
| 34 | captured, |
| 35 | ), |
| 36 | ), |
| 37 | ) |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Bridge from Effect into a Promise-returning JS callback while preserving |
nothing calls this directly
no test coverage detected