@esfx/async-iter-fn
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@esfx/async-iter-fn

An fp-style async iteration API for ECMAScript iterables.

Overview

Installation

npm i @esfx/async-iter-fn

Usage

import { mapAsync, filterAsync } from "@esfx/async-iter-fn";

// nested
const computerIsbns = mapAsync(filterAsync(books, book => book.categories.includes("computers")), book => book.isbn);

// or, pipe-like
let _;
const computerIsbns = (
    _= books,
    _= filterAsync(_, book => book.categories.includes("computers")),
    _= mapAsync(_, book => book.isbn),
    _);

// or, with actual pipes (if you are using a transpiler with support for Hack-style)
const computerIsbns = books
    |> filterAsync(%, book => book.categories.includes("computers")),
    |> mapAsync(%, book => book.isbn);

API

You can read more about the API here.

Readme

Keywords

none

Package Sidebar

Install

npm i @esfx/async-iter-fn

Weekly Downloads

0

Version

1.0.2

License

Apache-2.0

Unpacked Size

918 kB

Total Files

46

Last publish

Collaborators

  • rbuckton