diff --git a/dev/functions/batch.html b/dev/functions/batch.html index ba15ff4..01cb281 100644 --- a/dev/functions/batch.html +++ b/dev/functions/batch.html @@ -7,4 +7,4 @@
const r1 = reactive(1);
const r2 = reactive(2);

// Log r1 and r2 every time they change.
syncEffect(() => {
console.log(r1.value, r2.value);
});

// Trigger multiple updates at once.
batch(() => {
// these two updates don't trigger the effect yet
r1.value = 2;
r2.value = 3;
});
// now the effect runs once
-

Type Parameters

Parameters

Returns T

+

Type Parameters

Parameters

Returns T

diff --git a/dev/functions/computed.html b/dev/functions/computed.html index b92efb7..ce24aaa 100644 --- a/dev/functions/computed.html +++ b/dev/functions/computed.html @@ -10,4 +10,4 @@
const foo = reactive(1);
const doubleFoo = computed(() => foo.value * 2);
console.log(doubleFoo.value); // 2

foo.value = 2;
console.log(doubleFoo.value); // 4
-

Type Parameters

Parameters

Returns ReadonlyReactive<T>

+

Type Parameters

Parameters

Returns ReadonlyReactive<T>

diff --git a/dev/functions/effect.html b/dev/functions/effect.html index 2c400d7..e27cd3b 100644 --- a/dev/functions/effect.html +++ b/dev/functions/effect.html @@ -22,4 +22,4 @@ This is done to avoid redundant executions as a result of many fine-grained changes.

If you need more control, take a look at syncEffect.

-

Parameters

Returns CleanupHandle

+

Parameters

Returns CleanupHandle

diff --git a/dev/functions/external.html b/dev/functions/external.html index cfc597a..9bf4a9e 100644 --- a/dev/functions/external.html +++ b/dev/functions/external.html @@ -11,4 +11,4 @@
// This example makes the state of an AbortSignal accessible as an reactive object.
const controller = new AbortController();
const signal = controller.signal;

const aborted = external(() => signal.aborted);
signal.addEventListener("abort", aborted.trigger);
console.log(aborted.value); // false

controller.abort(); // triggers the event handler registered above
console.log(aborted.value); // true

// later: unsubscribe from signal
-

Type Parameters

Parameters

Returns ExternalReactive<T>

+

Type Parameters

Parameters

Returns ExternalReactive<T>

diff --git a/dev/functions/getValue.html b/dev/functions/getValue.html index 2a8298d..f8f9de0 100644 --- a/dev/functions/getValue.html +++ b/dev/functions/getValue.html @@ -1,4 +1,4 @@ getValue | @conterra/reactivity-core - v0.4.1
  • Returns the current .value of the given signal, or the input argument itself if it is not reactive.

    The access to .value is tracked.

    -

    Type Parameters

    • T

    Parameters

    Returns T

+

Type Parameters

Parameters

Returns T

diff --git a/dev/functions/isReactive.html b/dev/functions/isReactive.html index 494ef92..037f759 100644 --- a/dev/functions/isReactive.html +++ b/dev/functions/isReactive.html @@ -1,2 +1,2 @@ isReactive | @conterra/reactivity-core - v0.4.1
  • Returns true if maybeReactive is any kind of writable signal.

    -

    Type Parameters

    • T

    Parameters

    Returns maybeReactive is Reactive<T>

+

Type Parameters

Parameters

Returns maybeReactive is Reactive<T>

diff --git a/dev/functions/isReadonlyReactive.html b/dev/functions/isReadonlyReactive.html index e8f8831..4344719 100644 --- a/dev/functions/isReadonlyReactive.html +++ b/dev/functions/isReadonlyReactive.html @@ -1,2 +1,2 @@ isReadonlyReactive | @conterra/reactivity-core - v0.4.1
+

Type Parameters

Parameters

Returns maybeReactive is ReadonlyReactive<T>

diff --git a/dev/functions/nextTick.html b/dev/functions/nextTick.html index b89a7bd..c2f2ea1 100644 --- a/dev/functions/nextTick.html +++ b/dev/functions/nextTick.html @@ -1,3 +1,3 @@ nextTick | @conterra/reactivity-core - v0.4.1
  • Returns a promise that resolves after all currently scheduled asynchronous callbacks have executed.

    This function is useful in tests to wait for the execution of side effects triggered by an asynchronous watch or an effect.

    -

    Returns Promise<void>

+

Returns Promise<void>

diff --git a/dev/functions/peekValue.html b/dev/functions/peekValue.html index b36dfc9..67cc629 100644 --- a/dev/functions/peekValue.html +++ b/dev/functions/peekValue.html @@ -1,4 +1,4 @@ peekValue | @conterra/reactivity-core - v0.4.1
  • Returns the current .value of the given signal, or the input argument itself if it is not reactive.

    The access to .value is not tracked.

    -

    Type Parameters

    • T

    Parameters

    Returns T

+

Type Parameters

Parameters

Returns T

diff --git a/dev/functions/reactive-1.html b/dev/functions/reactive-1.html index e07f69e..fd8fb0b 100644 --- a/dev/functions/reactive-1.html +++ b/dev/functions/reactive-1.html @@ -3,9 +3,9 @@
const foo = reactive<number>();
console.log(foo.value); // undefined
foo.value = 123; // updates the current value
-

Type Parameters

Returns Reactive<T | undefined>

  • Creates a new mutable signal, initialized to the given value.

    +

    Type Parameters

    Returns Reactive<T | undefined>

  • Creates a new mutable signal, initialized to the given value.

    Example:

    const foo = reactive(123);
    console.log(foo.value); // 123
    foo.value = 456; // updates the current value
    -

    Type Parameters

    Parameters

    Returns Reactive<T>

  • +

    Type Parameters

    Parameters

    Returns Reactive<T>

    diff --git a/dev/functions/reactiveArray-1.html b/dev/functions/reactiveArray-1.html index e44160b..eb3730d 100644 --- a/dev/functions/reactiveArray-1.html +++ b/dev/functions/reactiveArray-1.html @@ -2,4 +2,4 @@

    Type Parameters

    Parameters

    Returns ReactiveArray<T>

    // Empty
    const array1 = reactiveArray<number>();

    // With initial content
    const array2 = reactiveArray<number>([1, 2, 3]);
    -
    +
    diff --git a/dev/functions/reactiveMap-1.html b/dev/functions/reactiveMap-1.html index 26e8709..0fb40d6 100644 --- a/dev/functions/reactiveMap-1.html +++ b/dev/functions/reactiveMap-1.html @@ -2,4 +2,4 @@

    Type Parameters

    Parameters

    Returns ReactiveMap<K, V>

    // Empty
    const map1 = reactiveMap<string, number>();

    // With initial content
    const map2 = reactiveMap<string, number>([["foo", 1], ["bar", 2]]);
    -
    +
    diff --git a/dev/functions/reactiveSet-1.html b/dev/functions/reactiveSet-1.html index 9cb7e16..a38037a 100644 --- a/dev/functions/reactiveSet-1.html +++ b/dev/functions/reactiveSet-1.html @@ -2,4 +2,4 @@

    Type Parameters

    Parameters

    Returns ReactiveSet<V>

    // Empty
    const set1 = reactiveSet<string>();

    // With initial content
    const set2 = reactiveSet<string>(["foo", "bar"]);
    -
    +
    diff --git a/dev/functions/reactiveStruct.html b/dev/functions/reactiveStruct.html index 7e9a7f2..8c3a187 100644 --- a/dev/functions/reactiveStruct.html +++ b/dev/functions/reactiveStruct.html @@ -62,4 +62,4 @@ All strings or symbols are allowed as property names, except for strings starting with '$'. Strings starting with '$' are reserved for future extensions.

    -

    Type Parameters

    Returns ReactiveStructBuilder<T>

    +

    Type Parameters

    Returns ReactiveStructBuilder<T>

    diff --git a/dev/functions/syncEffect.html b/dev/functions/syncEffect.html index 6072b58..ae27aef 100644 --- a/dev/functions/syncEffect.html +++ b/dev/functions/syncEffect.html @@ -13,4 +13,4 @@
    const handle = syncEffect(() => {
    // ...
    });
    // later:
    handle.destroy();
    -

    Parameters

    Returns CleanupHandle

    +

    Parameters

    Returns CleanupHandle

    diff --git a/dev/functions/syncEffectOnce.html b/dev/functions/syncEffectOnce.html index f6ea96a..6758678 100644 --- a/dev/functions/syncEffectOnce.html +++ b/dev/functions/syncEffectOnce.html @@ -3,4 +3,4 @@

    This gives users of this API the ability to listen for values that might have changed without doing much work. Typically, onInvalidate will be very cheap (e.g. schedule a new render).

    Note that onInvalidate will never be invoked more than once.

    -

    Parameters

    Returns CleanupHandle

    +

    Parameters

    Returns CleanupHandle

    diff --git a/dev/functions/syncWatch.html b/dev/functions/syncWatch.html index 258eb64..d135c39 100644 --- a/dev/functions/syncWatch.html +++ b/dev/functions/syncWatch.html @@ -17,8 +17,8 @@

    Type Parameters

    Parameters

    Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    +
  • Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    Type Parameters

    Parameters

    Returns CleanupHandle

  • +

    Returns CleanupHandle

    diff --git a/dev/functions/syncWatchValue.html b/dev/functions/syncWatchValue.html index 5fdccba..76b2388 100644 --- a/dev/functions/syncWatchValue.html +++ b/dev/functions/syncWatchValue.html @@ -17,8 +17,8 @@

    Type Parameters

    Parameters

    Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    +
  • Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    Type Parameters

    Parameters

    Returns CleanupHandle

  • +

    Returns CleanupHandle

    diff --git a/dev/functions/untracked.html b/dev/functions/untracked.html index 1563a68..da4a5ca 100644 --- a/dev/functions/untracked.html +++ b/dev/functions/untracked.html @@ -2,4 +2,4 @@

    Accesses on reactive objects made inside callback will not be tracked, even if they occur inside a computed object or in an effect.

    untracked returns the value of callback().

    -

    Type Parameters

    Parameters

    Returns T

    +

    Type Parameters

    Parameters

    Returns T

    diff --git a/dev/functions/watch.html b/dev/functions/watch.html index e150061..a3e4d3d 100644 --- a/dev/functions/watch.html +++ b/dev/functions/watch.html @@ -31,8 +31,8 @@

    Type Parameters

    Parameters

    Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    +
  • Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    Type Parameters

    Parameters

    Returns CleanupHandle

  • +

    Returns CleanupHandle

    diff --git a/dev/functions/watchValue.html b/dev/functions/watchValue.html index 04bd37e..217977b 100644 --- a/dev/functions/watchValue.html +++ b/dev/functions/watchValue.html @@ -30,8 +30,8 @@

    Type Parameters

    Parameters

    Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    +
  • Returns CleanupHandle

  • This overload is used when immediate is not set to false.

    Type Parameters

    Parameters

    Returns CleanupHandle

  • +

    Returns CleanupHandle

    diff --git a/dev/interfaces/CleanupHandle.html b/dev/interfaces/CleanupHandle.html index 4e6cdd8..5d48fe3 100644 --- a/dev/interfaces/CleanupHandle.html +++ b/dev/interfaces/CleanupHandle.html @@ -1,5 +1,5 @@ CleanupHandle | @conterra/reactivity-core - v0.4.1

    A handle returned by various functions to dispose of a resource, such as a watcher or an effect.

    -
    interface CleanupHandle {
        destroy(): void;
    }

    Methods

    interface CleanupHandle {
        destroy(): void;
    }

    Methods

    Methods

    • Performs the cleanup action associated with the resource.

      -

      Returns void

    +

    Returns void

    diff --git a/dev/interfaces/ComputedMemberType.html b/dev/interfaces/ComputedMemberType.html index f105672..afbf7b0 100644 --- a/dev/interfaces/ComputedMemberType.html +++ b/dev/interfaces/ComputedMemberType.html @@ -1,6 +1,6 @@ ComputedMemberType | @conterra/reactivity-core - v0.4.1

    Interface ComputedMemberType<T, V>

    A computed property of a reactive struct.

    -
    interface ComputedMemberType<T, V> {
        compute: ((this: T) => V);
        type?: "computed";
    }

    Type Parameters

    • T
    • V

    Properties

    interface ComputedMemberType<T, V> {
        compute: ((this: T) => V);
        type?: "computed";
    }

    Type Parameters

    • T
    • V

    Properties

    Properties

    compute: ((this: T) => V)

    The function to compute the value of the property.

    -
    type?: "computed"

    Type to indicate that this member is a computed property.

    -
    +
    type?: "computed"

    Type to indicate that this member is a computed property.

    +
    diff --git a/dev/interfaces/ExternalReactive.html b/dev/interfaces/ExternalReactive.html index fe2d900..0bd4d82 100644 --- a/dev/interfaces/ExternalReactive.html +++ b/dev/interfaces/ExternalReactive.html @@ -1,24 +1,24 @@ ExternalReactive | @conterra/reactivity-core - v0.4.1

    Interface ExternalReactive<T>

    A signal that holds a value from an external source.

    Instances of this type are used to integrate "foreign" state into the reactivity system.

    -
    interface ExternalReactive<T> {
        value: T;
        peek(): T;
        toJSON(): T;
        toString(): string;
        trigger(): void;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    interface ExternalReactive<T> {
        value: T;
        peek(): T;
        toJSON(): T;
        toString(): string;
        trigger(): void;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    Properties

    Methods

    • Accesses the current value without being considered a user of this value.

      Use this method if you do not wish to be notified about changes.

      -

      Returns T

    • Notifies the reactivity system that the external value has changed.

      The users of this value will be notified automatically; if there are any users then the value will be re-computed from its external source using the original callback.

      NOTE: This function is bound to its instance. You can use it directly as an event handler callback without safeguarding this.

      -

      Returns void

    Properties

    value: T

    Accesses the current value stored in this signal.

    +

    Returns void

    Properties

    value: T

    Accesses the current value stored in this signal.

    This access is tracked: users (computed signals, effects, etc.) will be registered as a user of this value and will be notified when it changes.

    -
    +
    diff --git a/dev/interfaces/MethodMemberType.html b/dev/interfaces/MethodMemberType.html index f727913..88b7292 100644 --- a/dev/interfaces/MethodMemberType.html +++ b/dev/interfaces/MethodMemberType.html @@ -1,6 +1,6 @@ MethodMemberType | @conterra/reactivity-core - v0.4.1

    Interface MethodMemberType<T, Params, Ret>

    A method of a reactive struct.

    -
    interface MethodMemberType<T, Params, Ret> {
        method: ((this: T, ...args: Params) => Ret);
        type?: "method";
    }

    Type Parameters

    • T
    • Params extends any[]
    • Ret

    Properties

    interface MethodMemberType<T, Params, Ret> {
        method: ((this: T, ...args: Params) => Ret);
        type?: "method";
    }

    Type Parameters

    • T
    • Params extends any[]
    • Ret

    Properties

    Properties

    method: ((this: T, ...args: Params) => Ret)

    The method of the struct.

    -
    type?: "method"

    Type to indicate that this member is a method.

    -
    +
    type?: "method"

    Type to indicate that this member is a method.

    +
    diff --git a/dev/interfaces/PropertyMemberType.html b/dev/interfaces/PropertyMemberType.html index 2760036..6c529ad 100644 --- a/dev/interfaces/PropertyMemberType.html +++ b/dev/interfaces/PropertyMemberType.html @@ -1,12 +1,12 @@ PropertyMemberType | @conterra/reactivity-core - v0.4.1

    A property of a reactive struct.

    -
    interface PropertyMemberType {
        reactive?: boolean;
        type?: "property";
        writable?: boolean;
    }

    Properties

    interface PropertyMemberType {
        reactive?: boolean;
        type?: "property";
        writable?: boolean;
    }

    Properties

    reactive?: boolean

    If true the property is reactive. If false the property is not reactive. Default is true.

    -
    type?: "property"

    Type to indicate that this member is a property.

    -
    writable?: boolean

    If true the property is writable and it can be changed. +

    type?: "property"

    Type to indicate that this member is a property.

    +
    writable?: boolean

    If true the property is writable and it can be changed. If false the property is read-only. Default is true.

    -
    +
    diff --git a/dev/interfaces/Reactive.html b/dev/interfaces/Reactive.html index 19c4020..6420176 100644 --- a/dev/interfaces/Reactive.html +++ b/dev/interfaces/Reactive.html @@ -1,16 +1,16 @@ Reactive | @conterra/reactivity-core - v0.4.1

    A signal that holds a mutable value.

    The value stored in this object can be changed through assignment, and all its users will be notified automatically.

    -
    interface Reactive<T> {
        value: T;
        peek(): T;
        toJSON(): T;
        toString(): string;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    interface Reactive<T> {
        value: T;
        peek(): T;
        toJSON(): T;
        toString(): string;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    Properties

    Methods

    • Accesses the current value without being considered a user of this value.

      Use this method if you do not wish to be notified about changes.

      -

      Returns T

    Properties

    value: T

    Reads or writes the current value in this reactive object.

    +

    Returns string

    Properties

    value: T

    Reads or writes the current value in this reactive object.

    +
    diff --git a/dev/interfaces/ReactiveArray.html b/dev/interfaces/ReactiveArray.html index d766b8c..1cd5584 100644 --- a/dev/interfaces/ReactiveArray.html +++ b/dev/interfaces/ReactiveArray.html @@ -4,7 +4,7 @@ using square brackets, i.e. use array.get(i) instead of array[i] and array.set(i, v) instead of array[i] = v. Not all builtin array methods are implemented right now, but most of them are.

    Reads and writes to this array are reactive.

    -
    interface ReactiveArray<T> {
        length: number;
        at(index: number): undefined | T;
        concat(...values: T[]): ReactiveArray<T>;
        concat(...values: (T | ReadonlyReactiveArray<T> | T[])[]): ReactiveArray<T>;
        entries(): IterableIterator<[index: number, value: T]>;
        every(predicate: ((value: T, index: number) => boolean)): boolean;
        filter<U>(predicate: ((value: T, index: number) => value is U)): ReactiveArray<U>;
        filter(predicate: ((value: T, index: number) => boolean)): ReactiveArray<T>;
        find<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        find(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findIndex(predicate: ((value: T, index: number) => boolean)): number;
        findLast<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        findLast(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findLastIndex(predicate: ((value: T, index: number) => boolean)): number;
        flatMap<U>(callback: ((value: T, index: number) => U | readonly U[])): ReactiveArray<U>;
        forEach(callback: ((value: T, index: number) => void)): void;
        get(index: number): undefined | T;
        getItems(): T[];
        includes(value: T, fromIndex?: number): boolean;
        indexOf(value: T, fromIndex?: number): number;
        keys(): IterableIterator<number>;
        lastIndexOf(value: T): number;
        map<U>(callback: ((value: T, index: number) => U)): ReactiveArray<U>;
        pop(): undefined | T;
        push(...values: T[]): void;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduce<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduceRight<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        set(index: number, value: T): void;
        shift(): undefined | T;
        slice(start?: number): ReactiveArray<T>;
        slice(start: number, end?: number): ReactiveArray<T>;
        some(predicate: ((value: T, index: number) => boolean)): boolean;
        sort(compare: ((a: T, b: T) => number)): void;
        splice(start: number, deleteCount?: number): T[];
        splice(start: number, deleteCount: number, ...values: T[]): T[];
        unshift(...values: T[]): void;
        values(): IterableIterator<T>;
    }

    Type Parameters

    Hierarchy (view full)

    Methods

    at +
    interface ReactiveArray<T> {
        length: number;
        at(index: number): undefined | T;
        concat(...values: T[]): ReactiveArray<T>;
        concat(...values: (T | ReadonlyReactiveArray<T> | T[])[]): ReactiveArray<T>;
        entries(): IterableIterator<[index: number, value: T]>;
        every(predicate: ((value: T, index: number) => boolean)): boolean;
        filter<U>(predicate: ((value: T, index: number) => value is U)): ReactiveArray<U>;
        filter(predicate: ((value: T, index: number) => boolean)): ReactiveArray<T>;
        find<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        find(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findIndex(predicate: ((value: T, index: number) => boolean)): number;
        findLast<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        findLast(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findLastIndex(predicate: ((value: T, index: number) => boolean)): number;
        flatMap<U>(callback: ((value: T, index: number) => U | readonly U[])): ReactiveArray<U>;
        forEach(callback: ((value: T, index: number) => void)): void;
        get(index: number): undefined | T;
        getItems(): T[];
        includes(value: T, fromIndex?: number): boolean;
        indexOf(value: T, fromIndex?: number): number;
        keys(): IterableIterator<number>;
        lastIndexOf(value: T): number;
        map<U>(callback: ((value: T, index: number) => U)): ReactiveArray<U>;
        pop(): undefined | T;
        push(...values: T[]): void;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduce<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduceRight<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        set(index: number, value: T): void;
        shift(): undefined | T;
        slice(start?: number): ReactiveArray<T>;
        slice(start: number, end?: number): ReactiveArray<T>;
        some(predicate: ((value: T, index: number) => boolean)): boolean;
        sort(compare: ((a: T, b: T) => number)): void;
        splice(start: number, deleteCount?: number): T[];
        splice(start: number, deleteCount: number, ...values: T[]): T[];
        unshift(...values: T[]): void;
        values(): IterableIterator<T>;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    at concat entries every @@ -38,90 +38,90 @@

    Methods

    • Returns the item at the given index, or undefined if the index is out of bounds. You can use negative indices to address items starting from the end of the array.

      See also Array.at.

      -

      Parameters

      • index: number

      Returns undefined | T

    • Returns true if the predicate is satisfied for every item in this array, false otherwise.

      See also Array.every.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns boolean

    • Returns a new array where only items are retained that fulfilled the given predicate.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns boolean

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns ReactiveArray<T>

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.find.

      -

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      +

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.find.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns the index of the first item that satisfies the given predicate, -1 if no such item was found.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns the index of the first item that satisfies the given predicate, -1 if no such item was found.

      See also Array.findIndex.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns number

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns number

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.findLast.

      -

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      +

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.findLast.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns the index of the first item that satisfies the given predicate, -1 if no such item was found.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns a new array where every item has been replaced with the result of calling the given callback function. +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns number

    • Returns a new array where every item has been replaced with the result of calling the given callback function. If the callback function returns an array, the items in that array are included individually.

      See also Array.flatMap.

      -

      Type Parameters

      • U

      Parameters

      • callback: ((value: T, index: number) => U | readonly U[])
          • (value, index): U | readonly U[]
          • Parameters

            • value: T
            • index: number

            Returns U | readonly U[]

      Returns ReactiveArray<U>

    • Searches for the given value and returns true if it was found, false otherwise.

      +

      Parameters

      • callback: ((value: T, index: number) => void)
          • (value, index): void
          • Parameters

            • value: T
            • index: number

            Returns void

      Returns void

    • Removes the last item from this array and returns it, or undefined if the array was empty.

      See also Array.pop.

      -

      Returns undefined | T

    • Appends all given values to the end of this array.

      +

      Returns undefined | T

    • Calls the given callback function for all items in this array. +

      Parameters

      • Rest...values: T[]

      Returns void

    • Calls the given callback function for all items in this array. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduce.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduce.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduce.

      -

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Calls the given callback function for all items in this array, starting from the back. +

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Calls the given callback function for all items in this array, starting from the back. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduceRight.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduceRight.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduceRight.

      -

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Removes the first value from this array and returns it, or undefined if the array was empty.

      +

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Removes the first value from this array and returns it, or undefined if the array was empty.

      See also Array.shift.

      -

      Returns undefined | T

    • Returns true if at least one item satisfies the given predicate, false otherwise.

      See also Array.some.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns boolean

    • Sorts this array using the given comparison function.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns boolean

    • Sorts this array using the given comparison function.

      See also Array.sort.

      -

      Parameters

      • compare: ((a: T, b: T) => number)
          • (a, b): number
          • Parameters

            Returns number

      Returns void

    • Changes the contents of this array by removing, replacing and optionally adding new elements.

      +

      Parameters

      • compare: ((a: T, b: T) => number)
          • (a, b): number
          • Parameters

            Returns number

      Returns void

    • Changes the contents of this array by removing, replacing and optionally adding new elements.

      See also Array.splice.

      -

      Parameters

      • start: number
      • OptionaldeleteCount: number

      Returns T[]

    • Changes the contents of this array by removing, replacing and optionally adding new elements.

      +

      Parameters

      • start: number
      • OptionaldeleteCount: number

      Returns T[]

    • Changes the contents of this array by removing, replacing and optionally adding new elements.

      See also Array.splice.

      -

      Parameters

      • start: number
      • deleteCount: number
      • Rest...values: T[]

      Returns T[]

    • Appends all given values to the beginning of this array.

      +

      Parameters

      • start: number
      • deleteCount: number
      • Rest...values: T[]

      Returns T[]

    Properties

    length: number

    Returns the current number of items in this array.

    -
    +

    Parameters

    • Rest...values: T[]

    Returns void

    Properties

    length: number

    Returns the current number of items in this array.

    +
    diff --git a/dev/interfaces/ReactiveMap.html b/dev/interfaces/ReactiveMap.html index dc105c3..0692883 100644 --- a/dev/interfaces/ReactiveMap.html +++ b/dev/interfaces/ReactiveMap.html @@ -1,7 +1,7 @@ ReactiveMap | @conterra/reactivity-core - v0.4.1

    Interface ReactiveMap<K, V>

    A reactive map.

    This map interface is designed to be very similar to (but not exactly the same as) the standard JavaScript Map.

    Reads from and writes to this map are reactive.

    -
    interface ReactiveMap<K, V> {
        size: number;
        [iterator](): IterableIterator<[key: K, value: V]>;
        clear(): void;
        delete(key: K): boolean;
        entries(): IterableIterator<[key: K, value: V]>;
        get(key: K): undefined | V;
        has(key: K): boolean;
        keys(): IterableIterator<K>;
        set(key: K, value: V): this;
        values(): IterableIterator<V>;
    }

    Type Parameters

    • K
    • V

    Hierarchy

    • Iterable<[key: K, value: V]>
      • ReactiveMap

    Methods

    interface ReactiveMap<K, V> {
        size: number;
        [iterator](): IterableIterator<[key: K, value: V]>;
        clear(): void;
        delete(key: K): boolean;
        entries(): IterableIterator<[key: K, value: V]>;
        get(key: K): undefined | V;
        has(key: K): boolean;
        keys(): IterableIterator<K>;
        set(key: K, value: V): this;
        values(): IterableIterator<V>;
    }

    Type Parameters

    • K
    • V

    Hierarchy

    • Iterable<[key: K, value: V]>
      • ReactiveMap

    Methods

    [iterator] clear delete entries @@ -12,14 +12,14 @@ values

    Properties

    Methods

    • Returns an iterator over the [key, value] entries in this map.

      -

      Returns IterableIterator<[key: K, value: V]>

    • Removes the entry for the given key. +

      Returns IterableIterator<[key: K, value: V]>

    • Removes the entry for the given key. Returns true if there was such an entry, or false otherwise.

      -

      Parameters

      • key: K

      Returns boolean

    • Returns an iterator over the [key, value] entries in this map.

      -

      Returns IterableIterator<[key: K, value: V]>

    • Returns the currently associated value for the given key, or undefined if there is no such value.

      -

      Parameters

      • key: K

      Returns undefined | V

    • Returns true if the map currently has an entry for the given key, false otherwise.

      -

      Parameters

      • key: K

      Returns boolean

    • Returns an iterator over the keys in this map.

      -

      Returns IterableIterator<K>

    • Associates the given key with value.

      -

      Parameters

      • key: K
      • value: V

      Returns this

    • Returns an iterator over the values in this map.

      -

      Returns IterableIterator<V>

    Properties

    size: number

    Returns the current number of entries.

    -
    +

    Parameters

    Returns boolean

    Properties

    size: number

    Returns the current number of entries.

    +
    diff --git a/dev/interfaces/ReactiveOptions.html b/dev/interfaces/ReactiveOptions.html index 69f676d..bf176be 100644 --- a/dev/interfaces/ReactiveOptions.html +++ b/dev/interfaces/ReactiveOptions.html @@ -1,7 +1,7 @@ ReactiveOptions | @conterra/reactivity-core - v0.4.1

    Interface ReactiveOptions<T>

    Options that can be passed when creating a new signal.

    -
    interface ReactiveOptions<T> {
        equal?: EqualsFunc<T>;
    }

    Type Parameters

    • T

    Properties

    interface ReactiveOptions<T> {
        equal?: EqualsFunc<T>;
    }

    Type Parameters

    • T

    Properties

    Properties

    equal?: EqualsFunc<T>

    Shall return true if the two values are considered equal.

    Reactive assignments using a new value equal to the current value will be ignored. By default, === is used to compare values.

    -
    +
    diff --git a/dev/interfaces/ReactiveSet.html b/dev/interfaces/ReactiveSet.html index a64d872..1a8a565 100644 --- a/dev/interfaces/ReactiveSet.html +++ b/dev/interfaces/ReactiveSet.html @@ -1,7 +1,7 @@ ReactiveSet | @conterra/reactivity-core - v0.4.1

    Interface ReactiveSet<V>

    A reactive set.

    This set interface is designed to be very similar to (but not exactly the same as) the standard JavaScript Set.

    Reads from and writes to this set are reactive.

    -
    interface ReactiveSet<V> {
        size: number;
        [iterator](): IterableIterator<V>;
        add(value: V): this;
        clear(): void;
        delete(value: V): boolean;
        entries(): IterableIterator<[value: V, value: V]>;
        has(value: V): boolean;
        values(): IterableIterator<V>;
    }

    Type Parameters

    • V

    Hierarchy

    • Iterable<V>
      • ReactiveSet

    Methods

    interface ReactiveSet<V> {
        size: number;
        [iterator](): IterableIterator<V>;
        add(value: V): this;
        clear(): void;
        delete(value: V): boolean;
        entries(): IterableIterator<[value: V, value: V]>;
        has(value: V): boolean;
        values(): IterableIterator<V>;
    }

    Type Parameters

    • V

    Hierarchy

    • Iterable<V>
      • ReactiveSet

    Methods

    [iterator] add clear delete @@ -10,15 +10,15 @@ values

    Properties

    Methods

    • Returns an iterator over the values in this set.

      -

      Returns IterableIterator<V>

    • Adds the given value to the set.

      -

      Parameters

      • value: V

      Returns this

    • Removes the given value from this set. +

      Returns IterableIterator<V>

    • Adds the given value to the set.

      +

      Parameters

      • value: V

      Returns this

    • Removes the given value from this set. Returns true if value was a previously in this set, or false otherwise.

      -

      Parameters

      • value: V

      Returns boolean

    • Returns an iterator over the [value, value] entries in this set.

      +

      Parameters

      • value: V

      Returns boolean

    • Returns an iterator over the [value, value] entries in this set.

      NOTE: This is actually in the JS Standard..

      -

      Returns IterableIterator<[value: V, value: V]>

    • Returns true if the set currently contains the given value, false otherwise.

      -

      Parameters

      • value: V

      Returns boolean

    • Returns an iterator over the values in this set.

      -

      Returns IterableIterator<V>

    Properties

    size: number

    Returns the current number of entries.

    -
    +

    Returns IterableIterator<[value: V, value: V]>

    Properties

    size: number

    Returns the current number of entries.

    +
    diff --git a/dev/interfaces/ReactiveStructBuilder.html b/dev/interfaces/ReactiveStructBuilder.html index 27024f1..8dd0a7c 100644 --- a/dev/interfaces/ReactiveStructBuilder.html +++ b/dev/interfaces/ReactiveStructBuilder.html @@ -1,4 +1,4 @@ ReactiveStructBuilder | @conterra/reactivity-core - v0.4.1

    Interface ReactiveStructBuilder<T>

    Used to build reactive structs using a struct definition.

    -
    interface ReactiveStructBuilder<T> {
        define<const Def>(def: Def): ReactiveStructConstructor<T, Def>;
    }

    Type Parameters

    • T

    Methods

    interface ReactiveStructBuilder<T> {
        define<const Def>(def: Def): ReactiveStructConstructor<T, Def>;
    }

    Type Parameters

    • T

    Methods

    Methods

    +

    Type Parameters

    Parameters

    Returns ReactiveStructConstructor<T, Def>

    diff --git a/dev/interfaces/ReactiveStructConstructor.html b/dev/interfaces/ReactiveStructConstructor.html index 7a2c617..0288c13 100644 --- a/dev/interfaces/ReactiveStructConstructor.html +++ b/dev/interfaces/ReactiveStructConstructor.html @@ -1,6 +1,6 @@ ReactiveStructConstructor | @conterra/reactivity-core - v0.4.1

    Interface ReactiveStructConstructor<T, Def>

    Constructor for reactive struct instances reactiveStruct.

    interface ReactiveStructConstructor<T, Def> {
        new ReactiveStructConstructornew (...args: ConstructorArgs<ConstructorProps<PropertyMembers<T, Def>>>): T;
    }

    Type Parameters

    • T

      The type of the struct.

    • Def

      The definition of the struct.

      -

    Constructors

    Constructors

    Constructors

    • Creates a new reactive struct instance.

      -

      Parameters

      • Rest...args: ConstructorArgs<ConstructorProps<PropertyMembers<T, Def>>>

      Returns T

    +

    Parameters

    Returns T

    diff --git a/dev/interfaces/ReadonlyReactive.html b/dev/interfaces/ReadonlyReactive.html index a040c67..30d725c 100644 --- a/dev/interfaces/ReadonlyReactive.html +++ b/dev/interfaces/ReadonlyReactive.html @@ -1,17 +1,17 @@ ReadonlyReactive | @conterra/reactivity-core - v0.4.1

    Interface ReadonlyReactive<T>

    A signal that holds a reactive value.

    When the value changes, all users of that value (computed signals, effects, watchers) are notified automatically.

    -
    interface ReadonlyReactive<T> {
        value: T;
        peek(): T;
        toJSON(): T;
        toString(): string;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    interface ReadonlyReactive<T> {
        value: T;
        peek(): T;
        toJSON(): T;
        toString(): string;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    Properties

    Methods

    • Accesses the current value without being considered a user of this value.

      Use this method if you do not wish to be notified about changes.

      -

      Returns T

    • Same as .value.

      For compatibility with builtin JS constructs.

      -

      Returns T

    • Formats .value as a string.

      +

      Returns T

    • Formats .value as a string.

      For compatibility with builtin JS constructs.

      -

      Returns string

    Properties

    value: T

    Accesses the current value stored in this signal.

    +

    Returns string

    Properties

    value: T

    Accesses the current value stored in this signal.

    This access is tracked: users (computed signals, effects, etc.) will be registered as a user of this value and will be notified when it changes.

    -
    +
    diff --git a/dev/interfaces/ReadonlyReactiveArray.html b/dev/interfaces/ReadonlyReactiveArray.html index 799beec..0c056e4 100644 --- a/dev/interfaces/ReadonlyReactiveArray.html +++ b/dev/interfaces/ReadonlyReactiveArray.html @@ -1,6 +1,6 @@ ReadonlyReactiveArray | @conterra/reactivity-core - v0.4.1

    Interface ReadonlyReactiveArray<T>

    Reactive array interface without modifying methods.

    See also ReactiveArray.

    -
    interface ReadonlyReactiveArray<T> {
        length: number;
        at(index: number): undefined | T;
        concat(...values: T[]): ReactiveArray<T>;
        concat(...values: (ReadonlyReactiveArray<T> | T | T[])[]): ReactiveArray<T>;
        entries(): IterableIterator<[index: number, value: T]>;
        every(predicate: ((value: T, index: number) => boolean)): boolean;
        filter<U>(predicate: ((value: T, index: number) => value is U)): ReactiveArray<U>;
        filter(predicate: ((value: T, index: number) => boolean)): ReactiveArray<T>;
        find<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        find(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findIndex(predicate: ((value: T, index: number) => boolean)): number;
        findLast<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        findLast(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findLastIndex(predicate: ((value: T, index: number) => boolean)): number;
        flatMap<U>(callback: ((value: T, index: number) => U | readonly U[])): ReactiveArray<U>;
        forEach(callback: ((value: T, index: number) => void)): void;
        get(index: number): undefined | T;
        getItems(): T[];
        includes(value: T, fromIndex?: number): boolean;
        indexOf(value: T, fromIndex?: number): number;
        keys(): IterableIterator<number>;
        lastIndexOf(value: T): number;
        map<U>(callback: ((value: T, index: number) => U)): ReactiveArray<U>;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduce<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduceRight<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        set(index: number, value: T): void;
        slice(start?: number): ReactiveArray<T>;
        slice(start: number, end?: number): ReactiveArray<T>;
        some(predicate: ((value: T, index: number) => boolean)): boolean;
        values(): IterableIterator<T>;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    at +
    interface ReadonlyReactiveArray<T> {
        length: number;
        at(index: number): undefined | T;
        concat(...values: T[]): ReactiveArray<T>;
        concat(...values: (ReadonlyReactiveArray<T> | T | T[])[]): ReactiveArray<T>;
        entries(): IterableIterator<[index: number, value: T]>;
        every(predicate: ((value: T, index: number) => boolean)): boolean;
        filter<U>(predicate: ((value: T, index: number) => value is U)): ReactiveArray<U>;
        filter(predicate: ((value: T, index: number) => boolean)): ReactiveArray<T>;
        find<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        find(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findIndex(predicate: ((value: T, index: number) => boolean)): number;
        findLast<U>(predicate: ((value: T, index: number) => value is U)): undefined | U;
        findLast(predicate: ((value: T, index: number) => boolean)): undefined | T;
        findLastIndex(predicate: ((value: T, index: number) => boolean)): number;
        flatMap<U>(callback: ((value: T, index: number) => U | readonly U[])): ReactiveArray<U>;
        forEach(callback: ((value: T, index: number) => void)): void;
        get(index: number): undefined | T;
        getItems(): T[];
        includes(value: T, fromIndex?: number): boolean;
        indexOf(value: T, fromIndex?: number): number;
        keys(): IterableIterator<number>;
        lastIndexOf(value: T): number;
        map<U>(callback: ((value: T, index: number) => U)): ReactiveArray<U>;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduce(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduce<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)): T;
        reduceRight(callback: ((previousValue: T, currentValue: T, currentIndex: number) => T), initialValue: T): T;
        reduceRight<U>(callback: ((previousValue: U, currentValue: T, currentIndex: number) => U), initialValue: U): U;
        set(index: number, value: T): void;
        slice(start?: number): ReactiveArray<T>;
        slice(start: number, end?: number): ReactiveArray<T>;
        some(predicate: ((value: T, index: number) => boolean)): boolean;
        values(): IterableIterator<T>;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    at concat entries every @@ -28,76 +28,76 @@

    Methods

    • Returns the item at the given index, or undefined if the index is out of bounds. You can use negative indices to address items starting from the end of the array.

      See also Array.at.

      -

      Parameters

      • index: number

      Returns undefined | T

    • Returns a new array with values concatenated to the end of the current content.

      +

      Parameters

      • index: number

      Returns undefined | T

    • Returns an iterator over the [index, value] entries in this array.

      -

      Returns IterableIterator<[index: number, value: T]>

    • Returns an iterator over the [index, value] entries in this array.

      +

      Returns IterableIterator<[index: number, value: T]>

    • Returns true if the predicate is satisfied for every item in this array, false otherwise.

      See also Array.every.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns boolean

    • Returns a new array where only items are retained that fulfilled the given predicate.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns boolean

    • Returns a new array where only items are retained that fulfilled the given predicate.

      See also Array.filter.

      -

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns ReactiveArray<U>

    • Returns a new array where only items are retained that fulfilled the given predicate.

      +

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns ReactiveArray<U>

    • Returns a new array where only items are retained that fulfilled the given predicate.

      See also Array.filter.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns ReactiveArray<T>

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns ReactiveArray<T>

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.find.

      -

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      +

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the first item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.find.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns the index of the first item that satisfies the given predicate, -1 if no such item was found.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns the index of the first item that satisfies the given predicate, -1 if no such item was found.

      See also Array.findIndex.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns number

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns number

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.findLast.

      -

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      +

      Type Parameters

      • U

      Parameters

      • predicate: ((value: T, index: number) => value is U)
          • (value, index): value is U
          • Parameters

            • value: T
            • index: number

            Returns value is U

      Returns undefined | U

    • Returns the last item that satisfies the given predicate, or undefined if there is no such item.

      See also Array.findLast.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns the index of the first item that satisfies the given predicate, -1 if no such item was found.

      +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns undefined | T

    • Returns the index of the first item that satisfies the given predicate, -1 if no such item was found.

      See also Array.findLastIndex.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns number

    • Returns a new array where every item has been replaced with the result of calling the given callback function. +

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns number

    • Returns a new array where every item has been replaced with the result of calling the given callback function. If the callback function returns an array, the items in that array are included individually.

      See also Array.flatMap.

      -

      Type Parameters

      • U

      Parameters

      • callback: ((value: T, index: number) => U | readonly U[])
          • (value, index): U | readonly U[]
          • Parameters

            • value: T
            • index: number

            Returns U | readonly U[]

      Returns ReactiveArray<U>

    • Executes the given callback for every item in the array.

      +

      Type Parameters

      • U

      Parameters

      • callback: ((value: T, index: number) => U | readonly U[])
          • (value, index): U | readonly U[]
          • Parameters

            • value: T
            • index: number

            Returns U | readonly U[]

      Returns ReactiveArray<U>

    • Executes the given callback for every item in the array.

      See also Array.forEach.

      -

      Parameters

      • callback: ((value: T, index: number) => void)
          • (value, index): void
          • Parameters

            • value: T
            • index: number

            Returns void

      Returns void

    • Returns the item at the given index, or undefined if the index is out of bounds.

      -

      Parameters

      • index: number

      Returns undefined | T

    • Returns a new, non-reactive array with this array's current content.

      -

      Returns T[]

    • Searches for the given value and returns true if it was found, false otherwise.

      +

      Parameters

      • callback: ((value: T, index: number) => void)
          • (value, index): void
          • Parameters

            • value: T
            • index: number

            Returns void

      Returns void

    • Returns the item at the given index, or undefined if the index is out of bounds.

      +

      Parameters

      • index: number

      Returns undefined | T

    • Returns a new, non-reactive array with this array's current content.

      +

      Returns T[]

    • Searches for the given value and returns true if it was found, false otherwise.

      See also Array.includes.

      -

      Parameters

      • value: T
      • OptionalfromIndex: number

      Returns boolean

    • Searches for the given value and returns its index, or -1 if it was not found.

      +

      Parameters

      • value: T
      • OptionalfromIndex: number

      Returns boolean

    • Searches for the given value and returns its index, or -1 if it was not found.

      See also Array.indexOf.

      -

      Parameters

      • value: T
      • OptionalfromIndex: number

      Returns number

    • Returns an iterator over the indices in this array.

      -

      Returns IterableIterator<number>

    • Searches backwards for the given value and returns its index, or -1 if it was not found.

      +

      Parameters

      • value: T
      • OptionalfromIndex: number

      Returns number

    • Returns an iterator over the indices in this array.

      +

      Returns IterableIterator<number>

    • Searches backwards for the given value and returns its index, or -1 if it was not found.

      See also Array.lastIndexOf.

      -

      Parameters

      • value: T

      Returns number

    • Returns a new array where every item has been replaced with the result of calling the given callback function.

      +

      Parameters

      • value: T

      Returns number

    • Returns a new array where every item has been replaced with the result of calling the given callback function.

      See also Array.map.

      -

      Type Parameters

      • U

      Parameters

      • callback: ((value: T, index: number) => U)
          • (value, index): U
          • Parameters

            • value: T
            • index: number

            Returns U

      Returns ReactiveArray<U>

    • Calls the given callback function for all items in this array. +

      Type Parameters

      • U

      Parameters

      • callback: ((value: T, index: number) => U)
          • (value, index): U
          • Parameters

            • value: T
            • index: number

            Returns U

      Returns ReactiveArray<U>

    • Calls the given callback function for all items in this array. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduce.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduce.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduce.

      -

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Calls the given callback function for all items in this array, starting from the back. +

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Calls the given callback function for all items in this array, starting from the back. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduceRight.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduceRight.

      -

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. +

      Parameters

      • callback: ((previousValue: T, currentValue: T, currentIndex: number) => T)
          • (previousValue, currentValue, currentIndex): T
          • Parameters

            • previousValue: T
            • currentValue: T
            • currentIndex: number

            Returns T

      • initialValue: T

      Returns T

    • Calls the given callback function for all items in this array, starting from the back. The return value of the previous callback invocation is passed in the next call. The final result of the callback will be returned from this function.

      See also Array.reduceRight.

      -

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Sets the item at the given index to value.

      -

      Parameters

      • index: number
      • value: T

      Returns void

    • Returns a shallow copy of this array.

      +

      Type Parameters

      • U

      Parameters

      • callback: ((previousValue: U, currentValue: T, currentIndex: number) => U)
          • (previousValue, currentValue, currentIndex): U
          • Parameters

            • previousValue: U
            • currentValue: T
            • currentIndex: number

            Returns U

      • initialValue: U

      Returns U

    • Sets the item at the given index to value.

      +

      Parameters

      • index: number
      • value: T

      Returns void

    • Returns true if at least one item satisfies the given predicate, false otherwise.

      +

      Parameters

      • start: number
      • Optionalend: number

      Returns ReactiveArray<T>

    • Returns true if at least one item satisfies the given predicate, false otherwise.

      See also Array.some.

      -

      Parameters

      • predicate: ((value: T, index: number) => boolean)
          • (value, index): boolean
          • Parameters

            • value: T
            • index: number

            Returns boolean

      Returns boolean

    • Returns an iterator over the items in this array.

      -

      Returns IterableIterator<T>

    Properties

    length: number

    Returns the current number of items in this array.

    -
    +

    Parameters

    Returns boolean

    Properties

    length: number

    Returns the current number of items in this array.

    +
    diff --git a/dev/interfaces/WatchOptions.html b/dev/interfaces/WatchOptions.html index e9de628..4d48114 100644 --- a/dev/interfaces/WatchOptions.html +++ b/dev/interfaces/WatchOptions.html @@ -1,11 +1,11 @@ WatchOptions | @conterra/reactivity-core - v0.4.1

    Interface WatchOptions<T>

    Options that can be passed to syncWatch.

    -
    interface WatchOptions<T> {
        immediate?: boolean;
        equal?(prev: T, next: T): boolean;
    }

    Type Parameters

    • T

    Methods

    interface WatchOptions<T> {
        immediate?: boolean;
        equal?(prev: T, next: T): boolean;
    }

    Type Parameters

    • T

    Methods

    Properties

    Methods

    • A function that returns true if the two values are considered equal. If this function is provided, the watch callback will only be triggered if this function returns false.

      By default, an implementation based on object identity is used.

      -

      Parameters

      • prev: T
      • next: T

      Returns boolean

    Properties

    immediate?: boolean

    Whether to call the watch callback once during setup (default: false).

    +

    Parameters

    • prev: T
    • next: T

    Returns boolean

    Properties

    immediate?: boolean

    Whether to call the watch callback once during setup (default: false).

    If this is false, the watch callback will only be invoked after at least a single value changed.

    If this is true, the callback will fire immediately.

    -
    +
    diff --git a/dev/types/CleanupFunc.html b/dev/types/CleanupFunc.html index 851bde2..e9692da 100644 --- a/dev/types/CleanupFunc.html +++ b/dev/types/CleanupFunc.html @@ -1,4 +1,4 @@ CleanupFunc | @conterra/reactivity-core - v0.4.1
    CleanupFunc: (() => void)

    A cleanup function returned from an effect or a watch callback.

    This function will be invoked before the effect or watch callback is triggered again, or when it is being disposed.

    -
    +
    diff --git a/dev/types/EffectCallback.html b/dev/types/EffectCallback.html index be1857f..375c4f0 100644 --- a/dev/types/EffectCallback.html +++ b/dev/types/EffectCallback.html @@ -3,4 +3,4 @@ dependencies change, the effect will be triggered again.

    An effect may return a cleanup function that will be executed before the effect is triggered again, or when the effect is being destroyed.

    -
    +
    diff --git a/dev/types/EqualsFunc.html b/dev/types/EqualsFunc.html index d16f058..d61758b 100644 --- a/dev/types/EqualsFunc.html +++ b/dev/types/EqualsFunc.html @@ -1,2 +1,2 @@ EqualsFunc | @conterra/reactivity-core - v0.4.1

    Type Alias EqualsFunc<T>

    EqualsFunc<T>: ((a: T, b: T) => boolean)

    A function that shall return true if a and b are considered equal, false otherwise.

    -

    Type Parameters

    • T
    +

    Type Parameters

    diff --git a/dev/types/ReactiveStructDefinition.html b/dev/types/ReactiveStructDefinition.html index 6086a46..023511c 100644 --- a/dev/types/ReactiveStructDefinition.html +++ b/dev/types/ReactiveStructDefinition.html @@ -1,4 +1,4 @@ ReactiveStructDefinition | @conterra/reactivity-core - v0.4.1

    Type Alias ReactiveStructDefinition<T>

    ReactiveStructDefinition<T>: {
        [key in keyof T]-?: GetMemberSchemaForProp<T, T[key]>
    }

    Definition of a reactive struct. All properties of T must be part of the definition.

    Type Parameters

    • T

      The type of the struct.

      -
    +
    diff --git a/dev/types/ReadonlyReactiveMap.html b/dev/types/ReadonlyReactiveMap.html index 9522f38..9b142f6 100644 --- a/dev/types/ReadonlyReactiveMap.html +++ b/dev/types/ReadonlyReactiveMap.html @@ -1,3 +1,3 @@ ReadonlyReactiveMap | @conterra/reactivity-core - v0.4.1

    Type Alias ReadonlyReactiveMap<K, V>

    ReadonlyReactiveMap<K, V>: Omit<ReactiveMap<K, V>, "set" | "delete" | "clear">

    Reactive map interface without modifying methods.

    See also ReactiveMap.

    -

    Type Parameters

    • K
    • V
    +

    Type Parameters

    diff --git a/dev/types/ReadonlyReactiveSet.html b/dev/types/ReadonlyReactiveSet.html index 04d753e..edd1f7e 100644 --- a/dev/types/ReadonlyReactiveSet.html +++ b/dev/types/ReadonlyReactiveSet.html @@ -1,3 +1,3 @@ ReadonlyReactiveSet | @conterra/reactivity-core - v0.4.1

    Type Alias ReadonlyReactiveSet<K>

    ReadonlyReactiveSet<K>: Omit<ReactiveSet<K>, "add" | "delete" | "clear">

    Reactive set interface without modifying methods.

    See also ReactiveSet.

    -

    Type Parameters

    • K
    +

    Type Parameters

    diff --git a/dev/types/WatchCallback.html b/dev/types/WatchCallback.html index 38eb56f..71b7875 100644 --- a/dev/types/WatchCallback.html +++ b/dev/types/WatchCallback.html @@ -4,4 +4,4 @@

    The body of a watch statement is not tracked.

    A watch callback may return a cleanup function that will be executed before the callback is triggered again, or when the watch is being destroyed.

    -

    Type Parameters

    +

    Type Parameters

    diff --git a/dev/types/WatchImmediateCallback.html b/dev/types/WatchImmediateCallback.html index 6b68a51..7dd8cfc 100644 --- a/dev/types/WatchImmediateCallback.html +++ b/dev/types/WatchImmediateCallback.html @@ -1,3 +1,3 @@ WatchImmediateCallback | @conterra/reactivity-core - v0.4.1

    Type Alias WatchImmediateCallback<T>

    WatchImmediateCallback<T>: ((value: T, oldValue: T | undefined) => void | CleanupFunc)

    Like WatchCallback, but the oldValue parameter may be undefined for the first invocation. This is the case when immediate: true has been passed to the watch function, in which case there cannot be a previous value.

    -

    Type Parameters

    • T
    +

    Type Parameters