Skip to content

Commit

Permalink
feat(atomFamily): add getParams to createAtom
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaskasky committed Jul 29, 2024
1 parent aeeb479 commit 6008aa7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vanilla/utils/atomFamily.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export function atomFamily<Param, AtomType extends Atom<unknown>>(
return newAtom
}

createAtom.getParams = () => {
return Array.from(atoms.keys())
}

createAtom.remove = (param: Param) => {
if (areEqual === undefined) {
atoms.delete(param)
Expand Down

0 comments on commit 6008aa7

Please sign in to comment.