Which hook to fetch API data with recoil #997
Unanswered
ivanjeremic
asked this question in
Q&A
Replies: 1 comment
-
You can use selectors/selectorFamilies to fetch data such as blog posts. There's an example of how to do that here: #996 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The docs say for selectors
Please keep in mind that selectors represent "idempotent" functions: For a given set of inputs they should always produce the same results (at least for the lifetime of the application).
Not sure I understand it but it sounds to me selectors need to have some atom state they depend on and the data returned by the selector is not supposed to change, so for me, it sounds like
selectors & slectorFamily
is not something I would use to fetch for example some blog posts from an rest api or can I?Beta Was this translation helpful? Give feedback.
All reactions