1

I use OrientJS with OrientDB to perform livequery. The subscription to live query has no problem but I could not find any way to unsubscribe from that event.

31piy
  • 23,323
  • 6
  • 47
  • 67
Ameer Jhan
  • 13
  • 3

1 Answers1

0

This will unsubscribe from the token which is returned on initializing the live query.

live unsubscribe ${token}

This token is acquired by using the returned data from the liveQuery resolver.

db.liveQuery(QUERY, {
  resolver: (a, b) => {
    const token = _.first(a).token;
      return a;
  },
})

Please note that you have to include return a to not break the built-in resolver.

mitchken
  • 790
  • 9
  • 26