API Reference / @evolu/common / Random / Random
Interface: Random
Defined in: packages/common/src/Random.ts:25
A simple wrapper around Math.random(). Most apps need only this. For more complex needs check RandomLibDep.
Example
// For apps
const random = createRandom();
random.next();
// For tests
const random = createRandomWithSeed("test");
random.next();
Properties
Property | Type | Description | Defined in |
---|---|---|---|
next | () => number | Returns a floating point number in [0, 1). Just like Math.random(). | packages/common/src/Random.ts:27 |