# rxjs-small

> 精简版的RXjs

Latest version **1.0.3** (published 2016-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install rxjs-small
pnpm add rxjs-small
yarn add rxjs-small
bun add rxjs-small
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-11-28 |
| First published | 2016-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | morejs |
| Maintainers | morejs |
| Keywords | 精简版的RXjs |

## Links

- npm: https://www.npmjs.com/package/rxjs-small
- Repository: https://github.com/moreJs/RXjs-small
- Homepage: https://github.com/moreJs/RXjs-small#readme
- Issues: https://github.com/moreJs/RXjs-small/issues
- npm.io page: https://npm.io/package/rxjs-small

## Dependencies (2)

- [is](https://npm.io/package/is.md) ^3.2.0
- [array.prototype.findindex](https://npm.io/package/array.prototype.findindex.md) ^2.0.0

## Recent versions

- 1.0.3 (latest) — 2016-11-28
- 1.0.2 — 2016-11-27
- 1.0.1 — 2016-11-26
- 1.0.0 — 2016-11-26

## README

# Rxjs 精简版 (inspire by Rxjs)
 - 主要用于个人学习


## 安装
***
### nodejs
- `rxjs-small`  is available on [npm](http://npmjs.org). To install it, type:

    $ npm install rxjs-small

###  基本使用

#### Observerable系列 (单路推送)

 ```js
    'use strict';

    const Observerable = require('rxjs-small').Observerable;

    const observerable = new Observerable((observer) => {
        let initial = 1;
        let id = setInterval(() => {
            observer.next(initial++);
        },1000);
        return () => {
            clearInterval(id);
        }
    });

    observerable.subscribe({
        next: value => console.log(`[value]=[${value}]`)
    });

    setTimeout(function() {
        observerable.unSubscribe();
    }, 5000);
 ```

 output:
```js
[value]=[1]
[value]=[2]
[value]=[3]
[value]=[4]
```


#### Subject系列 (多路推送)
```js
'use strict';

const Subject = require('rxjs-small').Subject;

const subject = new Subject();

subject.subscribe({
  next: (v) => console.log('observerA: ' + v)
});

subject.next(1);
subject.next(2);

subject.subscribe({
  next: (v) => console.log('observerB: ' + v)
});

subject.next(3)
```
output:

```js
observerA: 1
observerA: 2
observerA: 3
observerB: 3
```

### 更多使用参考 demo 目录

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