jondashkyle / nanopage

super handy utilities for traversing flat content state
Apache License 2.0
42 stars 4 forks source link

Add array methods #18

Open jondashkyle opened 6 years ago

jondashkyle commented 6 years ago

Should just expose array methods, too!

.forEach()
.filter()
.reduce()
.map()
jongacnik commented 6 years ago

feel like it is clearer to just rely on https://github.com/jondashkyle/nanopage#toarray when you want array methods, that way we're not selectively proxying them? wut u think?

jondashkyle commented 6 years ago

Totally. I was thinking something like this could be useful.

var pages = page().pages().filter(name => name === 'jon').paginate(2, 10).toArray()

But yeah, either way.