holepunchto/hyperbee

Change notification?

Closed this issue · 4 comments

Is there a way to get notifications about changes, like db.watch in hyperdb?

atm you'll have to use the diff stream for that. we should def add a helper for that.

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? 🤔

Diff is very efficient on large updates. Having a watch method that tells if you a prefix has changed makes sense as well

LuKks commented

db.watch([range]) added: #81