Reactive Utilities

batch

Edit this page
import { batch } from "solid-js"
function batch<T>(fn: () => T): T

This is a low level API that is used by Solid to batch updates. It holds executing downstream computations within the block until the end to prevent unnecessary recalculation. Solid Store's set method, Mutable Store's array methods, and Effects automatically wrap their code in a batch. This is useful for when you want to batch a set of computations that are not wrapped in a batch already.

Report an issue with this page