# Ids

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:

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

## Variables

### IdGenerator

> `const` **IdGenerator**: `Reference`<() => `string`>

Defined in: [src/Ids.ts:15](https://github.com/davidnussio/effect-cqrs/blob/9d66af7141782f3f89655e6868abe3f141c97632/src/Ids.ts#L15)

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

***

### next

> `const` **next**: `Effect.Effect`<`string`>

Defined in: [src/Ids.ts:20](https://github.com/davidnussio/effect-cqrs/blob/9d66af7141782f3f89655e6868abe3f141c97632/src/Ids.ts#L20)

A new id from the current generator.

## Functions

### sequential()

> **sequential**(`prefix?`): () => `string`

Defined in: [src/Ids.ts:23](https://github.com/davidnussio/effect-cqrs/blob/9d66af7141782f3f89655e6868abe3f141c97632/src/Ids.ts#L23)

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

#### Parameters

##### prefix?

`string` = `"id"`

#### Returns

() => `string`
