Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ElementMemory

Memory that can also keep track of injected DOM elements.

This class doesn't actually touch the Memory.memory at all, but provides a similar interface for HTML Elements.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private injectedMemory

injectedMemory: ProxiedNamespace<Node[]>

Private internalInjectedMemory

internalInjectedMemory: Namespace<Node[]>

Protected internalMemory

internalMemory: Namespace

memory

Methods

Protected assignMemory

forget

  • forget(key: string, forgetNamespace?: undefined | false | true): void
  • Delete the value of the provided namespace key.

    Parameters

    • key: string
    • Optional forgetNamespace: undefined | false | true

      if true this operation behaves like Memory.resetMemory with the key as an argument. Otherwise it merely removes the specified namespace.

    Returns void

injected

  • injected(el: Node, ns?: undefined | string): void
  • Keep track of the given element such that it can be removed later.

    see

    ElementMemory.removeInjected to remove elements

    Parameters

    • el: Node
    • Optional ns: undefined | string

    Returns void

remember

  • remember(key: string, value: any): void
  • Store the given value under the namespace key.

    Parameters

    • key: string

      Namespaces are separated by a dot

    • value: any

    Returns void

removeInjected

  • removeInjected(...namespaces: string[]): void
  • Remove all elements from the given namespaces. Removing elements of a namespace also removes all elements in namespaces further down.

    If no namespaces provided removes all elements.

    Parameters

    • Rest ...namespaces: string[]

    Returns void

resetMemory

  • resetMemory(...namespaces: string[]): void
  • Reset the given namespaces and all their children.

    When called with no arguments this flushes the entire memory (i.e. deletes all keys).

    see

    Memory.forget to remove a specific namespace without affecting its children.

    Parameters

    • Rest ...namespaces: string[]

    Returns void

Generated using TypeDoc