mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
3 lines
278 B
TypeScript
3 lines
278 B
TypeScript
import * as Effect from "effect/Effect"
|
|
Effect.runPromise((Effect.gen(function* () { let calls=0;const get=yield* Effect.cached(Effect.sync(()=>++calls));return [yield* get,yield* get,calls]; })).pipe(Effect.tap(value => Effect.sync(() => console.log(JSON.stringify(value))))))
|