-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion about Recoil patterns #17
Comments
Could you point to the Recoil Europe video you're mentioning? I don't understand the benefit of using memoization with recoil. (but I'm not familiar with the topic) Do you mean it would be possible to update only one node/edge at a time, instead of updating the whole dataset? The code you're looking for is:
My reasoning behind this design was I didn't want to update all nodes when mutating a single node (in practice, that never happens), or to update all edges when mutating a single node (that happens much more often). But, having the ability to control the whole dataset and each element individually to avoid rendering everything when something changes would be very interesting, performances-wise. |
Sorry for the delay! I had a lot of work to do! Yes, I was talking about this video https://www.youtube.com/watch?v=_ISAA_Jt9kI&ab_channel=ReactEurope that appears in the main page of recoil js. Yes! It is exactly that, It makes it possible to update only one node/edge at a time, instead of updating the whole dataset. I can do a PR with a small change to do it for those atoms you mentioned and we can discuss it on the PR 👌🏻 |
@ulises-jeremias Hey! I was away a few months working on something else, I don't quite remember where we left the conversation, but I'm still interested in having the dual ability of mutating the whole dataset at once, or item by item. Have things evolved on Recoil's side? Edit: I haven't watched the video, I'll do it soon! |
The video is really interesting, I've learned a few things! I'd love a PR, if you still have the time 😄 |
Hey! Yes! Recoil is more stable now and also I planned some new features for the devtools hehe |
I think we can keep this issue open to track the progress and continue the discussions here |
Awesome! One thing I didn't quite get by watching the video is how to achieve both "per-item" and "batch" mutations. As some operations will need to mutate all elements at once (e.g: "reset" feature), although most of them should perform per-item mutations, for better performances. Also, I wonder how that change should affect the DB. At this moment both the DB and the If we change the way Altough it's possible not to do everything at once (start with Recoil first), it's something worth being considered for later. |
I just saw the different states that can be found on this repo and I wanted to ask if it is possible to define states that contains arrays using memoization (or if is already being defined like this).
For example, you have the atom
So I can imagine that there is another state that contains nodes like this
and use it as
but maybe it is interesting to use something like this that react europe showed on their video about recoil using memoization
and use it as
so then you can implement components for specific single atoms, and then render those components inside a
.map
or things like that.What do you think? would it be possible to think of something like this for this project?
The text was updated successfully, but these errors were encountered: