Product Promotion
0x5a.live
for different kinds of informations and explorations.
GitHub - marpple/FxTS: A functional programming library for TypeScript/JavaScript
A functional programming library for TypeScript/JavaScript - marpple/FxTS
Visit SiteGitHub - marpple/FxTS: A functional programming library for TypeScript/JavaScript
A functional programming library for TypeScript/JavaScript - marpple/FxTS
Powered by 0x5a.live ๐
FxTS
FxTS is a functional library for TypeScript/JavaScript programmers.
Why FxTS?
- Lazy evaluation
- Handling concurrent requests
- Type inference
- Follow iteration protocols Iterable / AsyncIterable
Installation
npm install @fxts/core
Documentation
Please review the API documentation
Usage
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)),
);
// chaining
fx(range(10))
.map((a) => a + 10)
.filter((a) => a % 2 === 0)
.take(2)
.each((a) => console.log(a));
Usage(concurrent)
import { concurrent, countBy, flat, fx, map, pipe, toAsync } from "@fxts/core";
// maybe 1 seconds api
const fetchWiki = (page: string) =>
fetch(`https://en.wikipedia.org/w/api.php?action=parse&page=${page}`);
const countWords = 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),
);
await countWords(); // 4 seconds
await countWords(2); // 2 seconds
you can start here
Build
npm run build
Running Test
npm test
Running Type Test
npm run compile:check
License
Apache License 2.0
JavaScript Resources
are all listed below.
GitHub - kenshin54/popline: Popline is an HTML5 Rich-Text-Editor Toolbar
resource
~/github.com
resource
GitHub - buunguyen/topbar: Tiny & beautiful site-wide progress indicator
resource
~/github.com
resource
GitHub - visionmedia/move.js: CSS3 backed JavaScript animation framework
resource
~/github.com
resource
GitHub - jDataView/jBinary: High-level API for working with binary data.
resource
~/github.com
resource
Made with โค๏ธ
to provide different kinds of informations and resources.