Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iterable-iterator/reduce
:bowl_with_spoon: Iterable reducers for JavaScript
https://github.com/iterable-iterator/reduce
Last synced: about 2 months ago
JSON representation
:bowl_with_spoon: Iterable reducers for JavaScript
- Host: GitHub
- URL: https://github.com/iterable-iterator/reduce
- Owner: iterable-iterator
- License: agpl-3.0
- Created: 2021-05-01T15:08:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-27T18:46:07.000Z (2 months ago)
- Last Synced: 2024-11-07T13:52:41.731Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://iterable-iterator.github.io/reduce
- Size: 2.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
:bowl_with_spoon: [@iterable-iterator/reduce](https://iterable-iterator.github.io/reduce)
==Iterable reducers for JavaScript.
See [docs](https://iterable-iterator.github.io/reduce/index.html).> :warning: Depending on your environment, the code may require
> `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).```js
import {range} from '@iterable-iterator/range';
import {reduce} from '@iterable-iterator/reduce';
import {mul, add} from '@functional-abstraction/operator';reduce( mul , range( 2 , 6 ) , 1 ) ; // 120
reduce( add , range( 2 , 6 ) , 1 ) ; // 15import {sum} from '@iterable-iterator/reduce';
sum( range( 6 ) ) ; // 15import {any, all, some} from '@iterable-iterator/reduce';
any( [ false* , true , ... ] ) ; // T
any( [ false* ] ) ; // F
all( [ true* , false , ... ] ) ; // F
all( [ true* ] ) ; // T
some( [ true , true , false , true , ... ] , 3 ) ; // T
some( [ true , false , true , false* ] , 3 ) ; // Fimport {increasing, decreasing} from "@total-order/primitive" ;
import {min, max} from '@iterable-iterator/reduce';
min( increasing , [ 2 , 1 , 3 ] ) ; // 1
max( increasing , [ 2 , 1 , 3 ] ) ; // 3
```[![License](https://img.shields.io/github/license/iterable-iterator/reduce.svg)](https://raw.githubusercontent.com/iterable-iterator/reduce/main/LICENSE)
[![Version](https://img.shields.io/npm/v/@iterable-iterator/reduce.svg)](https://www.npmjs.org/package/@iterable-iterator/reduce)
[![Tests](https://img.shields.io/github/actions/workflow/status/iterable-iterator/reduce/ci.yml?branch=main&event=push&label=tests)](https://github.com/iterable-iterator/reduce/actions/workflows/ci.yml?query=branch:main)
[![Dependencies](https://img.shields.io/librariesio/github/iterable-iterator/reduce.svg)](https://github.com/iterable-iterator/reduce/network/dependencies)
[![GitHub issues](https://img.shields.io/github/issues/iterable-iterator/reduce.svg)](https://github.com/iterable-iterator/reduce/issues)
[![Downloads](https://img.shields.io/npm/dm/@iterable-iterator/reduce.svg)](https://www.npmjs.org/package/@iterable-iterator/reduce)[![Code issues](https://img.shields.io/codeclimate/issues/iterable-iterator/reduce.svg)](https://codeclimate.com/github/iterable-iterator/reduce/issues)
[![Code maintainability](https://img.shields.io/codeclimate/maintainability/iterable-iterator/reduce.svg)](https://codeclimate.com/github/iterable-iterator/reduce/trends/churn)
[![Code coverage (cov)](https://img.shields.io/codecov/c/gh/iterable-iterator/reduce/main.svg)](https://codecov.io/gh/iterable-iterator/reduce)
[![Code technical debt](https://img.shields.io/codeclimate/tech-debt/iterable-iterator/reduce.svg)](https://codeclimate.com/github/iterable-iterator/reduce/trends/technical_debt)
[![Documentation](https://iterable-iterator.github.io/reduce/badge.svg)](https://iterable-iterator.github.io/reduce/source.html)
[![Package size](https://img.shields.io/bundlephobia/minzip/@iterable-iterator/reduce)](https://bundlephobia.com/result?p=@iterable-iterator/reduce)