dexie/Dexie.js

How to use liveQuery() in Vue with reactive query paramters

Open

#1528 aperta il 31 mar 2022

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)JavaScript (625 fork)batch import
contribution wantedgood first issue

Metriche repository

Star
 (10.304 star)
Metriche merge PR
 (Merge medio 2g 5h) (3 PR mergiate in 30 g)

Descrizione

I want to implement a pagination, Did Vue have reactive query variable like React hooks useLiveQuery() second parameter deps?

const limit = ref(50);
const items = useObservable(liveQuery(
        () =>
         db.orderBy("creat")
            .limit(limit.value)  // the limit is reavtive ref, but change limit not triger the items change.
            .toArray()
      ))

Guida contributor