alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
23 lines (21 loc) • 462 B
JavaScript
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
};