Class StoreCollection<T, V>Abstract

Collection backed by a Solid.js Store

Type Parameters

  • T

  • V

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, T> = ...
#storage: ObjectStorage<V> = ...
getUnderlyingObject: ((id: string) => V)

Type declaration

    • (id: string): V
    • Parameters

      • id: string

      Returns V

updateUnderlyingObject: SetStoreFunction<Record<string, V>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "user" | "server" | "channel" | "bot" | "channelUnread" | "channelWebhook" | "emoji" | "message" | "serverMember" | "session"

      Type

    • instance: T

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Filter the collection by a given predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns T[]

  • Find some value based on a predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns undefined | T

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: T, key: string, map: ReactiveMap<string, T>) => void)

      Callback for each pair

        • (value: T, key: string, map: ReactiveMap<string, T>): void
        • Parameters

          • value: T
          • key: string
          • map: ReactiveMap<string, T>

          Returns void

    Returns void

  • Check whether an object is partially defined

    Returns

    Whether it is a partial

    Parameters

    • id: string

      Id

    Returns boolean

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value: T, key: string) => O)

      Callback

        • (value: T, key: string): O
        • Parameters

          • value: T
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc