tablecloth icon indicating copy to clipboard operation
tablecloth copied to clipboard

List.chunksOf drops remaining elements

Open pbiggar opened this issue 3 years ago • 2 comments

The current docs for List.chunksOf say that "If there aren't enough elements to make the last 'chunk', those elements are ignored."

This is a bad thing, and led me to have issues in production.

pbiggar avatar Dec 25 '21 00:12 pbiggar

Also look into List.sliding

pbiggar avatar Dec 25 '21 00:12 pbiggar

Similar functions in Ramda and Lodash do not guarantee that the final chunk will have the same length as the other elements. I guess this should be the default behavior for the Tablecloth as well, and the current behavior should be renamed to chunksOfStrict or something like that.

Lomand avatar Dec 25 '21 11:12 Lomand