zandaqo / structurae

Data structures for high-performance JavaScript applications.
MIT License
694 stars 21 forks source link

Iterators / cursors #4

Closed NateTheGreatt closed 4 years ago

NateTheGreatt commented 4 years ago

Hello!

First of all, thanks for your hard work on this library! @SupremeTechnopriest and I are really loving it so far :).

I am curious if you have plans to implement, or have any ideas on a custom implementation, of iterators/cursors over your ArrayViews? I want to run small, mostly pure functions over the binary data and mutate it as I go.

zandaqo commented 4 years ago

Hi!

Yes, it's not described in documentation, but ArrayView does have iterator. It iterates over views and you can use it in all the usual ways with for..of, destructuring, etc. I guess it's also not shown in IDEs because it's missing in the TypeScript declaration file, I'll have to fix that.

Or do you mean some other kind of iteration?

NateTheGreatt commented 4 years ago

Ahh okay nice. Thanks