mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
* Expand static compilation for common Effect 4 patterns * Run every Effect 4 fixture slice in CI * Preserve existing corpus behavior across Effect 4 lowering * Preserve Effect platform callbacks and native stream state * Record new corpus baselines and retain child stdin refusals * Retire the obsolete stateful regex diagnostic * Preserve promise reference count layout for cycle collection
6 lines
556 B
TypeScript
6 lines
556 B
TypeScript
import * as Effect from "effect/Effect"
|
|
import * as Layer from "effect/Layer"
|
|
import * as LayerRef from "effect/LayerRef"
|
|
import * as Context from "effect/Context"
|
|
const S=Context.Service<number>("S");let builds=0;Effect.runPromise((Effect.gen(function*(){const r=yield* LayerRef.make(Layer.effect(S,Effect.sync(()=>++builds)));const a=yield* S.pipe(Effect.provide(r.get));yield* r.refresh;const b=yield* S.pipe(Effect.provide(r.get));return [a,b,builds]}).pipe(Effect.scoped)).pipe(Effect.tap(value=>Effect.sync(()=>console.log(JSON.stringify(value))))))
|