Closed JohannesKlauss closed 3 years ago
Thanks! I may agree that it does make more sense to have get
and set
. At this point, however, I was wondering what could we name the function returning the tuple. Perhaps it could be ditched altogether?
This is your suggestion if I understand correctly:
import { getRecoil, setRecoil } from "recoil-nexus"
Implemented in 0.1.5
Having an API with names like
useRecoilNexusValue
in a react context implies that these functions are hooks.Since this is trying to give access to recoil atoms outside of React components I think that the naming of the API is doubling the confusion.
It feels like one would use hooks outside of React which is not the case. It could also lead to the impression that hooks are available outside a React component tree, which is also not the case.
So my suggestion would be to rename
use
toget
, since these aren't hooks.This would also get rid of the es-lint warning altogether.