Secondary primitives

createDeferred

Edit this page
import { createDeferred } from "solid-js"
function createDeferred<T>(
source: () => T,
options?: {
timeoutMs?: number
equals?: false | ((prev: T, next: T) => boolean)
name?: string
}
): () => T

Creates a readonly that only notifies downstream changes when the browser is idle. timeoutMs is the maximum time to wait before forcing the update.


Options

timeoutMs

Type: number

The maximum time to wait before forcing the update.

equals

Type: false | ((prev: T, next: T) => boolean)

A function that returns true if the value has changed.

name

Type: string

The name of the readonly.

Report an issue with this page