Open beorn opened 1 month ago
Good idea! PR appreciated!
For the AutoFetchCollection
it wouldn't change that much, as queries only being registered at the first run and unregistered when the reactive scope is disposed. Reruns of queries shouldn't trigger a new registering/fetching from the server.
Currently it seems that all queries are re-run when changes happen, which can be very slow both locally and result in additional queries to the remote server (in the case of AutoFetchCollection).
RxDB implements an Event Reduce algorithm that updates query results based on database change events, which is more optimal. This will allow much more expensive and long persisted remote queries in AutoFetchCollection (since they don't have to be re-run all the time), and presumably more efficient reactivity updates internally too.