# xstream-group-by

> An xstream operator to emit streams grouped by requested key

Latest version **1.0.0** (published 2022-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install xstream-group-by
pnpm add xstream-group-by
yarn add xstream-group-by
bun add xstream-group-by
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-05-12 |
| First published | 2022-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 48.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nikhil Tilwalli |
| Maintainers | ntilwalli |

## Links

- npm: https://www.npmjs.com/package/xstream-group-by
- Repository: https://github.com/ntilwalli/xstream-group-by
- Homepage: https://github.com/ntilwalli/xstream-group-by#readme
- Issues: https://github.com/ntilwalli/xstream-group-by/issues
- npm.io page: https://npm.io/package/xstream-group-by

## Dependencies (1)

- [xstream](https://npm.io/package/xstream.md) >=6.6.0

## Recent versions

- 1.0.0 (latest) — 2022-05-12

## README

# `xstream-group-by`

```
pnpm install --save xstream-group-by
```

Emits streams grouped by requested key

## usage

```js
import xs from 'xstream'
import fromDiagram from 'xstream/extra/fromDiagram'
import flattenConcurrently from 'xstream/extra/flattenConcurrently'
import groupBy from 'xstream-group-by'
 
xs.of(
  { id: 1, name: 'JavaScript' },
  { id: 2, name: 'Parcel' },
  { id: 2, name: 'webpack' },
  { id: 1, name: 'TypeScript' },
  { id: 3, name: 'TSLint' }
)
.compose(groupBy(p => p.id))
.map(group$ => group$.map(x => [x.id, x]))
.compose(flattenConcurrently)
.addListener({
  next: p => console.log('group: ' + p[0] + ', ' + p[1].name),
  error: err => console.error(err),
  complete: () => console.log('completed')
});
```

```text
> starting
> group 1: Javascript
> group 2: Parcel
> group 2: webpack
> group 1: Typescript
> group 3: TSLint
> completed
```

## License

MIT

---
_Source: https://npm.io/package/xstream-group-by · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
