Replies: 2 comments 2 replies
-
Thank you for creating this discussion 💙
Another benefit of the result is that it lazily loads data. I.e. it doesn't eagerly load all objects matching your query into memory as an array would do.
I see - this could be a significant drawback 🤔 For what it's worth, our realm-js/packages/realm/src/Collection.ts Line 65 in 7540fe7 And the I have a few clarifying questions:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick response.
I'm integrating Realm into an existing app. Since there was a concrete data flow in components, it is almost impossible to use full potential of live Results. I really appreciate it if there was a hook that actually returned the concrete, non-live and non-lazy values as an array so I can instantly work with. Here is an example. I have a schema for my users called I usually need the data immediately in my components and custom hooks. I wonder if it would be possible to have this feature (data being lazy and live) as optional or have it in another hook like |
Beta Was this translation helpful? Give feedback.
-
In the React ecosystem, queries are designed to re-render components whenever data updates, ensuring reactivity and seamless integration with state changes. While Result is valuable for live data and reactivity with listeners, it introduces complexity when integrating with React components. Returning a Result<> type requires an additional step to convert it into a raw array before it can be used in our applications. This extra step complicates the workflow and diminishes the ease of use that React developers expect.
Beta Was this translation helpful? Give feedback.
All reactions