https://github.com/cyclejs/callbags
A set of commonly used stream operators implemented as callbags with Typescript and ES modules
https://github.com/cyclejs/callbags
callbags cyclejs typescript
Last synced: about 1 year ago
JSON representation
A set of commonly used stream operators implemented as callbags with Typescript and ES modules
- Host: GitHub
- URL: https://github.com/cyclejs/callbags
- Owner: cyclejs
- License: mit
- Created: 2020-01-26T13:58:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T09:28:18.000Z (over 2 years ago)
- Last Synced: 2024-10-30T00:55:12.951Z (over 1 year ago)
- Topics: callbags, cyclejs, typescript
- Language: TypeScript
- Size: 259 KB
- Stars: 49
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @cycle/callbags
 [](https://codecov.io/gh/cyclejs/callbags) [](https://github.com/prettier/prettier)
This is the set of [callbags](https://github.com/callbag/callbag/blob/master/readme.md) that will most likely be used in the next version of Cycle.js. They are written in TypeScript and export ES modules to allow for tree shaking. Also, the implementation is specifically tailored to the Cycle.js use case, so all of them are push-only. Using them with sink or operators that try to pull the sources here will most likely lead to bugs und weird behavior.
## Building
This project uses [`pnpm`](https://pnpm.js.org/), other package managers might work, but only pnpm has a lockfile that pins dependencies. To build run:
```
pnpm install
pnpm run build
```
## Implemented operators
Currently, the following set of operators is implemented, others might follow. Note that this repo is not designed to become the "official" home of callbags, so after a basic set is implemented it is very unlikely that further operators will be added. This is no problem in practise as all of the callbags here adhere to the spec, so you can easily mix and match them with any callbag operator out there.
### Factories
- [`fromArray`](./src/from.ts)
- [`fromPromise`](./src/from.ts)
- [`from`](./src/from.ts)
- [`of`](./src/from.ts)
- [`create`](./src/identities.ts)
- [`never`](./src/identities.ts)
- [`empty`](./src/identities.ts)
- [`throwError`](./src/identities.ts)
- [`merge`](./src/merge.ts)
- [`combine`](./src/combine.ts)
- [`combineWith`](./src/combine.ts)
- [`makeSubject`](./src/subject.ts)
- [`makeAsyncSubject`](./src/subject.ts)
### Operators
- [`map`](./src/map.ts)
- [`scan`](./src/map.ts)
- [`debug`](./src/map.ts)
- [`take`](./src/take.ts)
- [`first`](./src/take.ts)
- [`filter`](./src/filter.ts)
- [`startWith`](./src/startWith.ts)
- [`drop`](./src/drop.ts)
- [`last`](./src/drop.ts)
- [`flatten`](./src/flatten.ts)
- [`sample`](./src/sample.ts)
- [`sampleWith`](./src/sample.ts)
- [`sampleCombine`](./src/sample.ts)
- [`multicast`](./src/multicast.ts)
- [`remember`](./src/remember.ts)
### Sinks
- [`subscribe`](./src/subscribe.ts)
### Helpers
- [`pipe`](./src/pipe.ts)