CottageCabbage / vu-dooit

Task Manager application for Web, Desktop and Mobile. Still in development
https://CottageCabbage.github.io/vu-dooit
3 stars 1 forks source link

Using liveQuery to get the open project's data, not sure if that's the best solution? #36

Open CottageCabbage opened 2 years ago

CottageCabbage commented 2 years ago

Code:

import { useObservable } from '@vueuse/rxjs';
import { liveQuery } from 'dexie';
import { db } from '../db';

const project = useObservable(
  liveQuery(() => db.projects.get({ id: route.params.id }))
);

Will try to learn more about this later, but is this performance friendly? I was thinking that maybe creating a new array with .filter and updating it independently would be better? Not sure if StackOverflow would be the right place to ask this kind of question.

Regardless, at least it works for now.