- Notifications
You must be signed in to change notification settings - Fork82
A functional programming library for TypeScript/JavaScript
License
NotificationsYou must be signed in to change notification settings
marpple/FxTS
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
FxTS is a functional library for TypeScript/JavaScript programmers.
- Lazy evaluation
- Handling concurrent requests
- Type inference
- Followiteration protocols Iterable / AsyncIterable
npm install @fxts/core
Please review theAPI documentation
import{each,filter,fx,map,pipe,range,take}from"@fxts/core";pipe(range(10),map((a)=>a+10),filter((a)=>a%2===0),take(2),each((a)=>console.log(a)),);// chainingfx(range(10)).map((a)=>a+10).filter((a)=>a%2===0).take(2).each((a)=>console.log(a));
import{concurrent,countBy,flat,fx,map,pipe,toAsync}from"@fxts/core";// maybe 1 seconds apiconstfetchWiki=(page:string)=>fetch(`https://en.wikipedia.org/w/api.php?action=parse&page=${page}`);constcountWords=async(concurrency:number)=>pipe(["html","css","javascript","typescript"],toAsync,map(fetchWiki),map((res)=>res.text()),map((words)=>words.split(" ")),flat,concurrent(concurrency),countBy((word)=>word),);awaitcountWords();// 4 secondsawaitcountWords(2);// 2 seconds
you can starthere
npm run build
npm test
npm run compile:check
Apache License 2.0
About
A functional programming library for TypeScript/JavaScript
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.