turbodombuilder - v0.9.22
    Preparing search index...

    Class TurboYBlock<YType, KeyType, IdType>

    Type Parameters

    • YType extends YMap | YArray = YMap | YArray
    • KeyType extends string | number | symbol = any
    • IdType extends string | number | symbol = any

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    id: IdType
    data: YType
    isInitialized: boolean = false
    changeObservers: TurboWeakSet<BlockChangeObserver<any, any, KeyType>> = ...
    onKeyChanged: Delegate<(key: KeyType, value: any) => void> = ...

    Accessors

    • get values(): unknown[]

      Returns unknown[]

    • set enabledCallbacks(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get keys(): KeyType[]
      Function

      keys

      Returns KeyType[]

      Array of keys.

      Retrieves all keys within the given block(s).

    • get size(): number
      Function

      size

      Returns number

      The size.

      Returns the size of the specified block.

    Methods

    • Returns object

    • Returns void

    • Returns void

    • Parameters

      • key: KeyType
      • value: unknown = ...
      • deleted: boolean = false

      Returns void

    • Function

      get

      Parameters

      Returns unknown

      The value associated with the key, or null if not found.

      Retrieves the value associated with a given key in the specified block.

    • Function

      set

      Parameters

      • key: KeyType

        The key to update.

      • value: unknown

        The value to assign.

      Returns void

      Sets the value for a given key in the specified block and triggers callbacks (if enabled).

    • Function

      initialize

      Returns void

      Initializes the block at the given key, and triggers callbacks for all the keys in its data.

    • Function

      clear

      Parameters

      • clearData: boolean = true

      Returns void

      Clears the block data.

    • Parameters

      • event: YEvent
      • transaction: any

      Returns void