Skip to content

🎥 Make videos programmatically with React

238 B
Raw Blame
export const waitForPromisesToFinish = async <
	T extends readonly PromiseLike<unknown>[],
>(
	promises: T,
) => {
	try {
		return await Promise.all(promises);
	} catch (error) {
		await Promise.allSettled(promises);
		throw error;
	}
};