Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A functional programming library for TypeScript/JavaScript

License

NotificationsYou must be signed in to change notification settings

marpple/FxTS

Repository files navigation

Build Statusnpm version

fxts-icon FxTS

FxTS is a functional library for TypeScript/JavaScript programmers.

Why FxTS?

  • Lazy evaluation
  • Handling concurrent requests
  • Type inference
  • Followiteration protocols Iterable / AsyncIterable

Installation

npm install @fxts/core

Documentation

Please review theAPI 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)),);// chainingfx(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 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

Build

  • npm run build

Running Test

  • npm test

Running Type Test

  • npm run compile:check

License

Apache License 2.0


[8]ページ先頭

©2009-2025 Movatter.jp