MCPcopy Index your code
hub / github.com/Effect-TS/effect / live

Function live

packages/effect/src/TestClock.ts:438–454  ·  view source on GitHub ↗
(data: Data)

Source from the content-addressed store, hash-verified

436 * @since 2.0.0
437 */
438export const live = (data: Data): Layer.Layer<TestClock, never, Annotations.TestAnnotations | Live.TestLive> =>
439 layer.scoped(
440 TestClock,
441 core.gen(function*() {
442 const live = yield* Live.TestLive
443 const annotations = yield* Annotations.TestAnnotations
444 const clockState = yield* core.sync(() => ref.unsafeMake(data))
445 const warningState = yield* circular.makeSynchronized(WarningData.start)
446 const suspendedWarningState = yield* circular.makeSynchronized(SuspendedWarningData.start)
447 const testClock = new TestClockImpl(clockState, live, annotations, warningState, suspendedWarningState)
448 yield* fiberRuntime.withClockScoped(testClock)
449 yield* fiberRuntime.addFinalizer(
450 () => core.zipRight(testClock.warningDone(), testClock.suspendedWarningDone())
451 )
452 return testClock
453 })
454 )
455
456/**
457 * @since 2.0.0

Callers 1

TestClock.tsFile · 0.85

Calls 4

warningDoneMethod · 0.95
suspendedWarningDoneMethod · 0.95
syncMethod · 0.80
addFinalizerMethod · 0.65

Tested by

no test coverage detected