Applesauce
    Preparing search index...

    A wrapper around an event database that handles replaceable events, deletes, and models

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    database: IEventDatabase
    destroy$: ReplaySubject<void> = ...

    Emits when EventModels.dispose is called to tear down all models. A ReplaySubject so reset notifiers subscribed after disposal fire immediately.

    eventLoader?: (
        pointer: AddressPointer | EventPointer | AddressPointerWithoutD,
    ) => Promise<NostrEvent | undefined> | Observable<NostrEvent>

    A method that will be called when an event isn't found in the store

    insert$: Subject<NostrEvent> = ...

    A stream of new events added to the store

    keepDeleted: boolean = false

    Keep deleted events in the store

    keepExpired: boolean = false

    Keep expired events in the store

    keepOldVersions: boolean = false

    Enable this to keep old versions of replaceable events

    memory: EventMemory

    Optional memory database for ensuring single event instances

    modelKeepWarm: number = 60_000

    How long a model should be kept "warm" while nothing is subscribed to it

    models: Map<
        ModelConstructor<any, any[], IEventStore | IAsyncEventStore>,
        Map<string, Observable<any>>,
    > = ...

    A directory of all active models

    remove$: Subject<NostrEvent> = ...

    A stream of events that have been removed

    update$: Subject<NostrEvent> = ...

    A stream of events that have been updated (Warning: this is a very noisy stream, use with caution)

    Accessors

    Methods

    • Tears down the store: disposes the attached event loader, completes the event streams, releases model keep-warm timers, and unsubscribes internal manager listeners.

      Returns void

      This is a terminal operation; the store should be discarded after calling it.