API reference / @evolu/common / Random / Random

Interface: Random

Defined in: packages/common/src/Random.ts:26

A simple wrapper around Math.random().

For more complex needs check RandomLibDep.

Example

// For apps
const random = createRandom();
random.next();

// For tests
const random = createRandomWithSeed("test");
random.next();

Properties

PropertyTypeDescriptionDefined in
next() => numberReturns a floating point number in [0, 1). Just like Math.random().packages/common/src/Random.ts:28

Was this page helpful?