UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

23 lines (21 loc) 462 B
import { atom } from "../../chunks/chunk-OBOPLPUQ.js"; import "../../chunks/chunk-U5RRZUYZ.js"; // src/dashboard/atoms/YAtom.ts function yAtom(yType, get) { const revision = atom(0); revision.onMount = (setAtom) => { const onChange = () => setAtom((x) => x + 1); onChange(); yType.observeDeep(onChange); return () => yType.unobserveDeep(onChange); }; return atom((g) => { g(revision); return get(); }); } export { yAtom };