1
0
silverbullet/plugbox/src/util.ts

14 lines
257 B
TypeScript
Raw Normal View History

2022-03-04 10:21:11 +00:00
export function safeRun(fn: () => Promise<void>) {
fn().catch((e) => {
console.error(e);
});
}
export function sleep(ms: number): Promise<void> {
return new Promise<void>((resolve) => {
setTimeout(() => {
resolve();
}, ms);
});
}