Open eznix86 opened 5 months ago
I have explored this idea. It would be interesting to know if this feature fits within the goals for the project. thoughts @dflourusso ?
Essentially the feature translates into making the orm reactive. There are several layers of complexity that would require much discussion.
I think it can be summarize like.
The library does a select and load it into state.
But instead of write arrays of data it loads an instance of the orm into memory.
It can extend useState or useContext but either way. It would be a nice addition.
right, but keep in mind that the "state" would be local to that one component. in a situation where you have multiple components loaded, tat "state" would not be shared with siblings. That could be an acceptable but not in al situations.
Agree 100 percent, what if it acts like a store, so the useSQLite is not just for one component but it is a store ?
and there is where things become slightly more complex than just tracking a single state. Don't get me wrong, doable, but I feel like creating a wrapper for expo-sqlite-orm in another repo would be better.
@eznix86 you have time to contribute to this?
I can try in my spare time. Do you mean in this repository or another project on top of this one ?
I hit you up on X but not sure if that's the best way to communicate. What I'm thinking is another project that has expo-sqlite-orm as a peer-deps. It would be easier for @dflourusso to port the code once we battle test this feature
Example