{"version":3,"file":"useAtom.cjs","names":["useSelector"],"sources":["../src/useAtom.ts"],"sourcesContent":["import { useSelector } from './useSelector'\nimport type { Atom } from '@tanstack/store'\nimport type { UseSelectorOptions } from './useSelector'\n\n/**\n * Returns the current atom value together with a stable setter.\n *\n * This is the writable-atom convenience hook for components that need to both\n * read and update the same atom.\n *\n * @example\n * ```tsx\n * const [count, setCount] = useAtom(countAtom)\n * ```\n */\nexport function useAtom<TValue>(\n  atom: Atom<TValue>,\n  options?: UseSelectorOptions<TValue>,\n): [TValue, Atom<TValue>['set']] {\n  const value = useSelector(atom, undefined, options)\n\n  return [value, atom.set]\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,QACd,MACA,SAC+B;AAG/B,QAAO,CAFOA,gCAAY,MAAM,QAAW,QAAQ,EAEpC,KAAK,IAAI"}