Skip to content

fabiandarga/js-chunked-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-chunked-array

This creates an iterable wrapper for an Array or Array-like object.
The Chunks are not generated on initialisation, but are available through the iterator.
Usage:

const chunked = new ChunkedArray(originalArray, sizeOfChunks);
chunked.next() // { value: first chunk, done: true when no chunks left}

The chunkedArray is iterable and can be used in for..of or with the ... spread operator

for (let chunk in chunked) {
    // do sometihng with each chunk
}
const allChunks = [...chunked];

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published