Implement createBatcher(commitFn) returning { schedule, flush }:
schedule(update) queues an update.flush() applies all queued updates in one commitFn(updates) call and clears the queue.solve(events) drives the batcher. Events are 'schedule:N' or 'flush'.
Returns the list of commit calls.
Sample tests