@jasonsbarr/iterable

0.11.0 • Public • Published

@jasonsbarr/iterable

A collection of iterable functions that work equally well on plain JavaScript arrays and other indexed iterables that implement a simple specification: they have a constructor method that doesn't take the new keyword.

Basic Usage

Just import the functions you need. They work with arrays just fine, or you can use another iterable type as long as it has a constructor method that doesn't require using new.

import { reject } from "@jasonsbarr/iterable/lib/reject";
import { isEven } from "@jasonsbarr/functional-core/lib/predicates/isEven";

const nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const odds = reject(isEven, nums);
console.log(odds); // -> [1, 3, 5, 7, 9]

Documentation

Documentation

Package Sidebar

Install

npm i @jasonsbarr/iterable

Weekly Downloads

0

Version

0.11.0

License

MIT

Unpacked Size

33.2 kB

Total Files

97

Last publish

Collaborators

  • jasonsbarr