axax
Version:
A library of async iterator extensions for JavaScript including ```map```, ```reduce```, ```filter```, ```flatMap```, ```pipe``` and [more](https://github.com/jamiemccrindle/axax/blob/master/docs/API.md#functions).
10 lines (9 loc) • 378 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const of_1 = require("../of");
const scan_1 = require("../scan");
const toArray_1 = require("../toArray");
test("scan", async () => {
const result = await toArray_1.toArray(scan_1.scan((accumulator, next) => accumulator + next, 0)(of_1.of(1, 2, 3)));
expect(result).toEqual([0, 1, 3, 6]);
});