A note store that holds a single replaceable event for a given user defined key generator function

Hierarchy (view full)

Constructors

Properties

#bufEmit: TaggedNostrEvent[] = []
#events: SortedMap<string, TaggedNostrEvent> = ...
#keyFn: ((ev) => string)

Type declaration

#nextEmit?: Timeout
#storeSnapshot: NoteStoreSnapshotData = []
prefixed: string | boolean

Accessors

Methods

  • Type Parameters

    • T extends "event"

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Returns void

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends "event"

    Parameters

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns "event"[]

  • Return the number of listeners listening to a given event.

    Parameters

    • event: "event"

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends "event"

    Parameters

    • event: T

    Returns ((...args) => void)[]

  • Type Parameters

    • T extends "event"

    Parameters

    • event: T
    • Optional fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns this

  • Add a listener for a given event.

    Type Parameters

    • T extends "event"

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends "event"

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: "event"

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends "event"

    Parameters

    • event: T
    • Optional fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns this

Generated using TypeDoc