mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
chore: Adding mainFn helpers
This commit is contained in:
8
lib/health/trigger/cooldownTrigger.ts
Normal file
8
lib/health/trigger/cooldownTrigger.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export function cooldownTrigger(timeMs: number) {
|
||||
return async function* () {
|
||||
while (true) {
|
||||
await new Promise((resolve) => setTimeout(resolve, timeMs));
|
||||
yield;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user