function defer(complete) {
    const promise = new Promise(resolve => delayedCall(0, resolve));

    if (complete) {
        promise.then(complete);
    }

    return promise;
}
Defers to the next tick.

@export
@param {function} [complete] Callback function.
@returns {Promise}
@example
defer(resize);
@example
defer(() => resize());
@example
await defer();