Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

EventGroup.ts overview

Since v1.0.0


Exports Grouped by Category


constructors

empty

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>

Source

Since v1.0.0

guards

isEventGroup

Signature

declare const isEventGroup: (u: unknown) => u is EventGroup.Any

Source

Since v1.0.0

models

EventGroup (interface)

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

export interface EventGroup<out Events extends Event.Any = never> extends Pipeable {
  new (_: never): {}

  readonly [TypeId]: TypeId
  readonly events: Record.ReadonlyRecord<string, Events>

  /**
   * Add an `Event` to the `EventGroup`.
   */
  add<
    Tag extends string,
    Payload extends Schema.Schema.Any = typeof Schema.Void,
    Success extends Schema.Schema.Any = typeof Schema.Void,
    Error extends Schema.Schema.All = typeof Schema.Never
  >(options: {
    readonly tag: Tag
    readonly primaryKey: (payload: Schema.Schema.Type<Payload>) => string
    readonly payload?: Payload
    readonly success?: Success
    readonly error?: Error
  }): EventGroup<Events | Event<Tag, Payload, Success, Error>>

  /**
   * Add an error schema to all the events in the `EventGroup`.
   */
  addError<Error extends Schema.Schema.Any>(error: Error): EventGroup<Event.AddError<Events, Error>>
}

Source

Since v1.0.0

EventGroup (namespace)

Source

Since v1.0.0

Any (interface)

Signature

export interface Any {
  readonly [TypeId]: TypeId
}

Source

Since v1.0.0

AnyWithProps (type alias)

Signature

type AnyWithProps = EventGroup<Event.AnyWithProps>

Source

Since v1.0.0

ToService (type alias)

Signature

type ToService<A> = A extends EventGroup<infer _Events> ? Event.ToService<_Events> : never

Source

Since v1.0.0

Events (type alias)

Signature

type Events<Group> = Group extends EventGroup<infer _Events> ? _Events : never

Source

Since v1.0.0

Context (type alias)

Signature

type Context<Group> = Event.Context<Events<Group>>

Source

Since v1.0.0

type ids

TypeId

Signature

declare const TypeId: unique symbol

Source

Since v1.0.0

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v1.0.0