Sha256: beab356b71346daa1c0a0288d79a916b890b8e2e5c3bbf980e1471608639fe34

Contents?: true

Size: 661 Bytes

Versions: 7

Compression:

Stored size: 661 Bytes

Contents

/**
 * Copy all properties from `props` onto `obj`.
 * @param {object} obj Object onto which properties should be copied.
 * @param {object} props Object from which to copy properties.
 * @returns {object}
 * @private
 */
export function extend(obj, props) {
	for (let i in props) obj[i] = props[i];
	return obj;
}

/**
 * Call a function asynchronously, as soon as possible. Makes
 * use of HTML Promise to schedule the callback if available,
 * otherwise falling back to `setTimeout` (mainly for IE<11).
 * @type {(callback: function) => void}
 */
export const defer = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
govuk_publishing_components-12.19.0 node_modules/preact/src/util.js
govuk_publishing_components-12.18.0 node_modules/preact/src/util.js
govuk_publishing_components-12.17.0 node_modules/preact/src/util.js
govuk_publishing_components-12.16.0 node_modules/preact/src/util.js
govuk_publishing_components-12.15.0 node_modules/preact/src/util.js
govuk_publishing_components-12.14.1 node_modules/preact/src/util.js
govuk_publishing_components-12.14.0 node_modules/preact/src/util.js