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

Function randomNumber

packages/effect/test/Effect/memoization.test.ts:24–24  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

22 it.effect("memoized function returns the same instance on repeated calls", () =>
23 it.flakyTest(Effect.gen(function*() {
24 const randomNumber = (n: number) => Random.nextIntBetween(n, n + n + 1)
25 const memoized = yield* (Effect.cachedFunction(randomNumber))
26 const a = yield* (memoized(10))
27 const b = yield* (memoized(10))

Callers

nothing calls this directly

Calls 1

nextIntBetweenMethod · 0.65

Tested by

no test coverage detected