mst-gql icon indicating copy to clipboard operation
mst-gql copied to clipboard

query using web worker?

Open barbalex opened this issue 5 years ago • 1 comments

My app works offline (more info here). To prevent the user from having to remember to sync data before going offline it queries all data at startup. This tends to degrade the user's experience during the first few seconds after starting up. There is a definite spike in cpu usage at startup.

A possible solution would be to query inside a web worker.

Has any one done this using mst-gql? Any hints as to how to tackle this? I have no idea how mst-gql works internally.

barbalex avatar Oct 06 '20 10:10 barbalex

Uups: https://stackoverflow.com/a/52373099/712005. Maybe the querying is not be the (biggest) problem. Rather what happens with the data afterwards.

barbalex avatar Oct 06 '20 10:10 barbalex

Hi @barbalex Im trying to help get all the issues organized. I see this has been sitting on the shelf for awhile... anything I can assist with?

Benz19 avatar Nov 07 '22 19:11 Benz19

@Benz19 Thanks a lot for your effort. I have moved that project off of mst-gql since so this is not bottering me. Feel free to close the isssue.

barbalex avatar Nov 07 '22 19:11 barbalex

I have moved that project off of mst-gql (...)

Sorry to hijack this thread, but I'm curious about why you moved off of mst-gql. Would you mind sharing why you did that? Thanks :)

fullofcaffeine avatar Feb 23 '24 19:02 fullofcaffeine

@fullofcaffeine Hi, curious hijacker ;-)

Offline-capable apps need to keep the data locally. When using this together with a method to keep the data live (some form of live queries), it can be easier to ditch state management libraries and use the data tools also for state.

In the mentioned app that was: WatermelonDB combined with RxJS. In my newer app (in development) it is SQLite with electric-sql.

Needing less concepts and tools reduces complexity.

barbalex avatar Feb 23 '24 19:02 barbalex

Nice, thanks for elaborating!

fullofcaffeine avatar Feb 23 '24 22:02 fullofcaffeine