( handler: (payload: HotPayload) => Promise<void>, )
| 2 | |
| 3 | class="cm">// updates to HMR should go one after another. It is possible to trigger another update during the invalidation for example. |
| 4 | export function createHMRHandler( |
| 5 | handler: (payload: HotPayload) => Promise<void>, |
| 6 | ): (payload: HotPayload) => Promise<void> { |
| 7 | const queue = new Queue() |
| 8 | return (payload) => queue.enqueue(() => handler(payload)) |
| 9 | } |
| 10 | |
| 11 | class Queue { |
| 12 | private queue: { |
no test coverage detected