(fn: () => T)
| 6 | // On the server we don't subscribe/render reactively, so a lightweight |
| 7 | // implementation that just executes is enough. |
| 8 | export function batch<T>(fn: () => T): T { |
| 9 | if (isServer) { |
| 10 | return fn() |
| 11 | } |
| 12 | |
| 13 | let result!: T |
| 14 | storeBatch(() => { |
| 15 | result = fn() |
| 16 | }) |
| 17 | return result |
| 18 | } |
no test coverage detected