Function domInputValue

  • A stream of values when the a HTMLInputElement changes. Eg a

    const r = Rx.From.domInputValue(`#myEl`);
    r.onValue(value => {
    // value will be string
    });

    Options:

    • emitInitialValue: If true emits the HTML value of element (default: false)
    • attributeName: If set, this is the HTML attribute value is set to when writing to stream (default: 'value')
    • fieldName: If set, this is the DOM object field set when writing to stream (default: 'value')
    • when: 'changed'|'changing' when values are emitted. (default: 'changed')
    • fallbackValue: Fallback value to use if field/attribute cannot be read (default: '')

    Parameters

    • targetOrQuery: string | HTMLInputElement
    • options: Partial<DomValueOptions> = {}

    Returns {
        el: HTMLInputElement;
    } & ReactiveInitial<string> & ReactiveWritable<string>