w8r / avl

:eyeglasses: Fast AVL tree for Node and browser

Home Page:https://npm.runkit.com/avl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Promise-based avl

andrefs opened this issue · comments

Hi there,

I'm currently adapting a fork of your avl module to work with an asynchronous comparator function.
I'm doing this because I have a use case where my comparator needs to perform a database query (and the data is too large to be pre-fetched before building the tree).

Basically, avl-promise works the same, except that the insert, remove, contains, range, load and find methods all return Promises instead of immediate values -- because they all depend on the comparator function.

I don't think it would be helpful to just add async versions of those methods to your module, so that's why I'm creating a new one.

I just wanted to give you a heads up that a module very similar to your own will appear on NPM and thank you for having written avl 👍 😄

All the best

André

great work, @andrefs !