Function withValue

  • A reactive where the last value can be read at any time. An initial value must be provided.

    const r = Rx.withValue(source, { initial: `hello` });
    r.last(); // Read last value

    Warning: Since most reactives only active when subscribed to, it's important to also subscribe to the results of r for this flow to happen. Alternatively, use lazy: 'never' as an option.

    Type Parameters

    • In

    Parameters

    Returns ReactiveInitial<In>