Skip to content

betafcc/sussJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

süß/JS

süß   /zyːs/
adj
   sweet, cute
noun
   the sound iteration makes over pure functional pipes

Install

npm install @betafcc/suss

Usage

Get an iterator/generator/iterable:

// Generate all Natural numbers
function* naturals() {
   for (let i = 0; true; i+=1)
       yield i;
}

Use the Fluent API:

import {suss} from '@betafcc/suss';

// Log all even squares
suss(naturals())
    .map(x => x*x)
    .filter(x => x % 2 === 0)
    .forEach(el => console.log(el));

Use the flow/pipe API:

import { flow,
         map, filter, forEach } from '@betafcc/suss';

// Log all even squares
flow(naturals())(
    map(x => x*x),
    filter(x => x % 2 === 0),
    forEach(el => console.log(el)),
);

About

Toolkit for JS Iterables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published