4 ms·
can a query like that be observable? so updating the array/object would cause the results to update?
by gryzzly 2y ago
can a query like that be observable? so updating the array/object would cause the results to update?
- af3d 2y agoAFAICT this library generates "flat" JSON objects. Wouldn't be too hard to implement it such that references to Javascript objects are instead returned, where some sort of callback could be invoked whenever the actual object is modified. I do rather like this "query engine" approach, too. It's a much cleaner interface IMO and doesn't seem to incur too much overhead either....
- jansommer 2y agoI don't know if RxJS has run out of fashion, but that would give you observable js using map/filter/reduce etc.
- throwitaway1123 2y agoDexie supports observable queries, but it operates on IndexedDB rather than plain JS objects: https://dexie.org/docs/liveQuery()#vanilla-js https://dexie.org/docs/liveQuery()#vanilla-js