manan-data 0.0.0

inventyv tikv datalayer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export async function delay({seconds, milliseconds} = {}) {
	let duration;
	if (typeof seconds === 'number') {
		duration = seconds * 1000;
	} else if (typeof milliseconds === 'number') {
		duration = milliseconds;
	} else {
		throw new TypeError('Expected an object with either `seconds` or `milliseconds`.');
	}

	return new Promise(resolve => {
		setTimeout(resolve, duration);
	});
}