Change notification?
Closed this issue · 4 comments
kamilchm commented
Is there a way to get notifications about changes, like db.watch in hyperdb?
mafintosh commented
atm you'll have to use the diff stream for that. we should def add a helper for that.
davetapley commented
hypertrie also offers this as db.watch(..)
.
It uses feed.on('append',...)
, then checks seq
to see if it needs to emit an event.
@mafintosh I'm not familiar with diff stream, is there a reason to prefer that approach to the hypertrie one? 🤔
mafintosh commented
Diff is very efficient on large updates. Having a watch method that tells if you a prefix has changed makes sense as well