# rxredis

> RxJS wrapper for redis

Latest version **0.0.4** (published 2017-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install rxredis
pnpm add rxredis
yarn add rxredis
bun add rxredis
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2017-05-29 |
| First published | 2016-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Thanatat Tamtan |
| Maintainers | acoshift |
| Keywords | rx, rxjs, redis |

## Links

- npm: https://www.npmjs.com/package/rxredis
- Repository: https://github.com/acoshift/rxredis
- Homepage: https://github.com/acoshift/rxredis#readme
- Issues: https://github.com/acoshift/rxredis/issues
- npm.io page: https://npm.io/package/rxredis

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2017-05-29
- 0.0.3 — 2016-07-03
- 0.0.2 — 2016-03-04
- 0.0.1 — 2016-02-28

## README

# RxRedis
RxJS wrapper for Redis

---
### Note
#### ioredis
multi and pipeline result will be map from `[[err, res], [err, res], ...]` to `[res, res, ...]`

and `[err, err, ...]` will be throw if some of `err != null`

---

### Example
```js
'use strict'
const Observable = require('rxjs').Observable
const Redis = require('ioredis')
const client = require('rxredis')(new Redis())

client
  .incr('test')
  .flatMap((id) => client.hmset(`test:${id}`, 'name', 'abc', 'value', Math.floor(Math.random() * 20)), (id) => id)
  .flatMap((id) => client.sadd('test:all', id), (id) => id)
  .flatMap((id) => client.hgetall(`test:${id}`))
  .repeat(10)
  .subscribe(console.log, console.error, () => console.log('1 Completed!'))

client
  .smembers('test:all')
  .flatMap(Observable.fromArray)
  .flatMap((id) => client.hgetall(`test:${id}`))
  .toArray()
  .subscribe(console.log, console.error, () => console.log('2 Completed!'))

client
  .pipeline()
  .hgetall('test:5')
  .sismember('test:all', 5)
  .get('test')
  .exec()
  .map((xs) => {
    let x = xs[0]
    x.id = 5
    x.isMember = xs[1]
    x.last = xs[2]
    return x
  })
  .subscribe(console.log, console.error, () => console.log('3 Completed!'))
```

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