Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

EventGroup

6 exports Since v1.0.0 Source

Constructors

Since v1.0.0

An EventGroup is a collection of Events. You can use an EventGroup to represent a portion of your domain.

The events can be implemented later using the EventLog.group api.

Signature

declare const empty: EventGroup<never>

Guards

Signature

declare function isEventGroup(u: unknown): u is Any

Models

EventGroup

interface
Since v1.0.0

An EventGroup is a collection of Events. You can use an EventGroup to represent a portion of your domain.

The events can be implemented later using the EventLogBuilder.group api.

Signature

interface EventGroup<out Events extends Event.Any = never> extends Pipeable {
constructor(_: never);
readonly [TypeId]: typeof TypeId;
readonly events: Record.ReadonlyRecord<string, Events>;
add<Tag extends string, Payload extends Any = Void, Success extends Any = Void, Error extends All = Never>(options: {
readonly error?: Error;
readonly payload?: Payload;
readonly primaryKey: (payload: Type<Payload>) => string;
readonly success?: Success;
readonly tag: Tag;
}): EventGroup<Events | Event<Tag, Payload, Success, Error>>;
addError<Error extends Any>(error: Error): EventGroup<AddError<Events, Error>>;
}

Type Ids

Since v1.0.0

Signature

declare const TypeId: unique symbol
Since v1.0.0

Signature

type TypeId = typeof TypeId