Closed theSherwood closed 11 months ago
I've removed the bi-directionality (prev
method on the cursor). Due to the bias of the sorting method, navigating backwards yields potentially surprising results. It would also be the only case of any api in the codebase that navigates backwards. So I removed it.
Hi @theSherwood , This is a great contribution to the project. But isn't better to call this mechanism "iterator"? AFAIK "cursor" is typically associated with databases, where it represents the current position in a result set, not a traverse mechanism itself. What do you think?
@alexbol99 No problem! I'll make those changes and get it pushed up.
@theSherwood ,
So maybe you can take it even one step further and implement it as iterable so that one can use for .. of
loop?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators
@alexbol99 Sure. I can do that
@alexbol99 Good call. Using a generator function made things a lot simpler.
Looks great! I will merge and release it tomorrow Thank you so much for collaboration
Great! Thanks for the quick turnaround on it all
Thanks for the interval tree implementation. I found I need some kind of cursor implementation. This is WIP, but I wanted to get it on your radar. Is a cursor implementation something you're open to?