Skip to content

Hook up to Dexie.js #369

Answered by Tao-VanJS
HEAVYPOLY asked this question in Q&A
Discussion options

You must be logged in to vote

Just use subscribe as they suggested?

const friends = vanX.reactive([])
const friendsObservable = liveQuery (
  () => db.friends
    .where('age')
    .between(50, 75)
    .toArray()
)

// Subscribe
const subscription = friendsObservable.subscribe({
  next: result => vanX.replace(friends, result),
  error: error => console.error(error)
})

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Tao-VanJS
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants