( callback: (runBatch: () => void) => void, shouldYield: Scheduler["shouldYield"] = defaultShouldYield )
| 323 | * @category constructors |
| 324 | */ |
| 325 | export const makeBatched = ( |
| 326 | callback: (runBatch: () => void) => void, |
| 327 | shouldYield: Scheduler["shouldYield"] = defaultShouldYield |
| 328 | ) => { |
| 329 | const getRunner = SchedulerRunner.cached((_, drain) => { |
| 330 | callback(() => drain(0)) |
| 331 | }) |
| 332 | |
| 333 | return make((task, priority, fiber) => { |
| 334 | getRunner(fiber).scheduleTask(task, priority) |
| 335 | }, shouldYield) |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * @since 2.0.0 |
no test coverage detected