ixfx
    Preparing search index...

    Function elements

    • Creates, updates & deletes elements based on pathed values from a reactive.

      This means that elements are only manipulated if its associated data changes, and elements are not modified if there's no need to.

      Type Parameters

      • T

      Parameters

      • source:
            | ReactiveDiff<T>
            | Reactive<T> & { set(value: T): void } & {
                onDiff(changes: (changes: PathDataChange<any>[]) => void): () => void;
                onField(
                    fieldName: string,
                    handler: (result: ObjectFieldHandler) => void,
                ): () => void;
                update(changedPart: RecursivePartial<T>): T;
                updateField(field: string, value: any): void;
            } & { last(): T }
        • ReactiveDiff<T>
        • Reactive<T> & { set(value: T): void } & {
              onDiff(changes: (changes: PathDataChange<any>[]) => void): () => void;
              onField(
                  fieldName: string,
                  handler: (result: ObjectFieldHandler) => void,
              ): () => void;
              update(changedPart: RecursivePartial<T>): T;
              updateField(field: string, value: any): void;
          } & { last(): T }
          • set:function
            • Sets a value

              Parameters

              • value: T

                Value to write

              Returns void

          • onDiff:function
            • Notifies of which field(s) were changed. If you just care about the whole, changed data use the value event.

              Use the returned function to unsubscribe.

              Parameters

              Returns () => void

          • onField:function
            • Notifies when the value of fieldName is changed.

              Use the returned function to unsubscribe.

              Parameters

              Returns () => void

          • update:function
            • Updates the reactive with some partial key-value pairs. Keys omitted are left the same as the current value.

              Parameters

              Returns T

              Returns new value

          • updateField:function
            • Updates a particular field by its path

              Parameters

              • field: string
              • value: any

              Returns void

          • last:function
            • Returns T

      • options: Partial<ElementsOptions>

      Returns void