UNPKG

@kobalte/core

Version:

Unstyled components and primitives for building accessible web apps and design systems with SolidJS.

12 lines (10 loc) 288 B
import type { Setter } from "solid-js"; /** * Create a function that call the setter with an id and return a function to reset it. */ export function createRegisterId(setter: Setter<string | undefined>) { return (id: string) => { setter(id); return () => setter(undefined); }; }