()
| 35 | } |
| 36 | } |
| 37 | const flush = (): void => { |
| 38 | const originalQueue = queue |
| 39 | queue = [] |
| 40 | if (originalQueue.length) { |
| 41 | scheduleFn(() => { |
| 42 | batchNotifyFn(() => { |
| 43 | originalQueue.forEach((callback) => { |
| 44 | notifyFn(callback) |
| 45 | }) |
| 46 | }) |
| 47 | }) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | return { |
| 52 | batch: <T>(callback: () => T): T => { |
no test coverage detected