UNPKG

@selenite/commons

Version:

This typescript package provides a set of frequently used utilities, types and svelte actions for building projects with Typescript and Svelte.

12 lines (11 loc) 223 B
export const autofocus = (node, active = true) => { if (!active) return; setTimeout(() => node.focus()); return { update(a) { if (a) node.focus(); } }; };