Skip to content

The ids the framework makes up: the correlation of a command run outside any causation, and of a saga started outside one. They are random UUIDs, and a test that compares them provides a generator of its own:

program.pipe(Effect.provideService(Ids.IdGenerator, Ids.sequential("id")))

const IdGenerator: Reference<() => string>

Defined in: src/Ids.ts:15

Makes a new id each time it is called. Defaults to crypto.randomUUID().


const next: Effect.Effect<string>

Defined in: src/Ids.ts:20

A new id from the current generator.

sequential(prefix?): () => string

Defined in: src/Ids.ts:23

A generator of id-1, id-2 and so on, for tests. Each call starts its own count.

string = "id"

() => string