EventJournal.ts overview
Since v1.0.0
Exports Grouped by Category
entry
Entry (class)
Signature
declare class Entry
Since v1.0.0
EntryId
Signature
declare const EntryId: Schema.brand<typeof Schema.Uint8ArrayFromSelf, unique symbol>
Since v1.0.0
EntryId (type alias)
Signature
type EntryId = typeof EntryId.Type
Since v1.0.0
EntryIdTypeId
Signature
declare const EntryIdTypeId: unique symbol
Since v1.0.0
RemoteEntry (class)
Signature
declare class RemoteEntry
Since v1.0.0
entryIdMillis
Signature
declare const entryIdMillis: (entryId: EntryId) => number
Since v1.0.0
makeEntryId
Signature
declare const makeEntryId: (options?: { msecs?: number }) => EntryId
Since v1.0.0
errors
ErrorTypeId
Signature
declare const ErrorTypeId: unique symbol
Since v1.0.0
ErrorTypeId (type alias)
Signature
type ErrorTypeId = typeof ErrorTypeId
Since v1.0.0
EventJournalError (class)
Signature
declare class EventJournalError
Since v1.0.0
[ErrorTypeId] (property)
Signature
readonly [ErrorTypeId]: unique symbol
Since v1.0.0
indexed db
layerIndexedDb
Signature
declare const layerIndexedDb: (options?: { readonly database?: string }) => Layer.Layer<EventJournal, EventJournalError>
Since v1.0.0
makeIndexedDb
Signature
declare const makeIndexedDb: (options?: {
readonly database?: string
}) => Effect.Effect<typeof EventJournal.Service, EventJournalError, Scope>
Since v1.0.0
memory
layerMemory
Signature
declare const layerMemory: Layer.Layer<EventJournal, never, never>
Since v1.0.0
makeMemory
Signature
declare const makeMemory: Effect.Effect<
{
readonly entries: Effect.Effect<ReadonlyArray<Entry>, EventJournalError>
readonly write: <A, E, R>(options: {
readonly event: string
readonly primaryKey: string
readonly payload: Uint8Array
readonly effect: (entry: Entry) => Effect.Effect<A, E, R>
}) => Effect.Effect<A, EventJournalError | E, R>
readonly writeFromRemote: (options: {
readonly remoteId: RemoteId
readonly entries: ReadonlyArray<RemoteEntry>
readonly compact?:
| ((
uncommitted: ReadonlyArray<RemoteEntry>
) => Effect.Effect<
ReadonlyArray<[compacted: ReadonlyArray<Entry>, remoteEntries: ReadonlyArray<RemoteEntry>]>,
EventJournalError
>)
| undefined
readonly effect: (options: {
readonly entry: Entry
readonly conflicts: ReadonlyArray<Entry>
}) => Effect.Effect<void, EventJournalError>
}) => Effect.Effect<void, EventJournalError>
readonly withRemoteUncommited: <A, E, R>(
remoteId: RemoteId,
f: (entries: ReadonlyArray<Entry>) => Effect.Effect<A, E, R>
) => Effect.Effect<A, EventJournalError | E, R>
readonly nextRemoteSequence: (remoteId: RemoteId) => Effect.Effect<number, EventJournalError>
readonly changes: Effect.Effect<Queue.Dequeue<Entry>, never, Scope>
readonly destroy: Effect.Effect<void, EventJournalError>
},
never,
never
>
Since v1.0.0
remote
RemoteId
Signature
declare const RemoteId: Schema.brand<typeof Schema.Uint8ArrayFromSelf, unique symbol>
Since v1.0.0
RemoteId (type alias)
Signature
type RemoteId = typeof RemoteId.Type
Since v1.0.0
RemoteIdTypeId
Signature
declare const RemoteIdTypeId: unique symbol
Since v1.0.0
makeRemoteId
Signature
declare const makeRemoteId: () => RemoteId
Since v1.0.0
tags
EventJournal (class)
Signature
declare class EventJournal
Since v1.0.0