preact-material-components
Version:
preact wrapper for "Material Components for the web"
14 lines (12 loc) • 377 B
JavaScript
/** Copy own-properties from `props` onto `obj`.
* @returns obj
* @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.
* @param {Function} callback
*/
export const defer = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;