toolish - v0.2.5
    Preparing search index...

    Class ReactiveArray<T>

    Wraps an array, supports patch and offers convenience methods to reactively mutate the array.

    // ReactiveArray supports most standard array mutation methods
    // notice some signatures are slightly different though
    reactiveArray.splice(1, 3, [3, 7]);

    // aliases are provided in an attempt to clarify some confusing names; e.g. these are equivalent:
    reactiveArray.addFirst(7);
    reactiveArray.unshift(7);

    // additional utility methods similar to those provided by the array module are also available
    reactiveArray.removeAll(1337);

    // Non-mutating standard array methods are not replicated
    // they can easily be used through derive:
    reactiveArray.derive(a => a.filter(...));

    // or if no reactivity is needed, just unwrap:
    reactiveArray.unwrap().filter(...);

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Remove elements from the end of the array. This is comparable to Array.pop but with arguably clearer naming.

      Parameters

      • count: number = 1

      Returns void

    • Remove elements from the beginning of the array. This is comparable to Array.shift but with arguably clearer naming.

      Parameters

      • count: number = 1

      Returns void

    • Remove elements at the given index within the array.

      Parameters

      • index: number
      • count: number = 1

      Returns void