Open stutrek opened 4 years ago
I think this one would require a change in where-clause.ts and collection.ts. We would need a testItem(item) method on Collection. To be able to implement that, we need to add more info on the CollectionContext interface.
A pull request that adds a testItem() method on Collection would be very welcome. I will at some point do it regardless, but as I have no time currently to do it, so please help me if you want to have it there.
If implementing it, where-clause maybe needs to put some new info about the operator. Specifically, those operators that use algorithms might need to have some complementary information.
If I get a chance, I absolutely will. However, I need this for a side project and not work so it might take a while. I can also work with just useTable
and useItem
for now.
The truly difficult part will be offsets.
I'm trying to make a set of React hooks for Dexie that load data and watch for updates with Dexie.Observable. You'd use them more or less like this:
I have a few crudely conceived ideas over here
The first two are simple because you can check the update from Dexie.Observable against a known table and id, but the where clause is significantly harder. Is there a way to see if an entity matches a where clause?
Thanks