• Creates a HTML element per value. By default compares values by JSON.stringify. Set byReference:true to compare values based on reference. Or provide a toString function via key.

    // Generate a random number between 0...4 every second
    const looper = Generators.interval(() => Math.floor(Math.random()*5), 1000);

    // Make a chain
    const ch = Chains.run(
    looper,
    Chains.Links.delay({before:1000}),
    Chains.Dom.perValue()
    );

    setTimeout(async () => {
    for await (const v of ch) {
    const {el,value} = v;
    el.textContent = `${value} - ${Date.now().toString()}`;
    }
    console.log(`ch iteration done`);
    });

    Type Parameters

    • In

    Parameters

    Returns Link<In, ElementWithValue<In>>