It would be nice not to depend on a 'global' map of atoms/selectors.
I think this should be easily refactorable. Instead of having atoms return a {key: 'someAtom'}, we can just return the Atom instance. When initializing Selectors, we need to pass the Atom to the Selector anyway, so we can rely on that directly.
This might be a problem for the devtools though, since the global Map is required for getting the initial states of atoms/selectors, but we might be able to work around that.
It would be nice not to depend on a 'global' map of atoms/selectors.
I think this should be easily refactorable. Instead of having atoms return a
{key: 'someAtom'}, we can just return theAtominstance. When initializing Selectors, we need to pass the Atom to the Selector anyway, so we can rely on that directly.This might be a problem for the devtools though, since the global Map is required for getting the initial states of atoms/selectors, but we might be able to work around that.