Function With

  • Behaves like the 'with' construct in many langusges. All method calls with return the same object and we can also access the special [assign] method to set properties without breaking the chain. Used for more concise syntax in some scenarios.

    Type Parameters

    • T

    Parameters

    • obj: T

    Returns IRecursive<T>

    Example

    import { With, ASSIGN } from 'deleight/withly';
    const el = With(document.createElement('div')).append().append()[ASSIGN]().append()().append();