skip to content

rxjs-proxify

 

📖 About

A smart Proxy for RxJS with good TypeScript support

🔗 Links:
See the homepage: github.com/kosich/rxjs-proxify
Read an intro article: "Turn a Stream of Objects into an Object of Streams"

📦 Install:

npm i rxjs-proxify

🛸 Examples

Access properties

Read property value at any depth:

1
2
3
4
5
6
7
8
9
10
11
const { rxObserver } = require('api/v0.3');
const { of } = require('rxjs');
const { map } = require('rxjs/operators');
const { proxify } = require('rxjs-proxify');

const source = of({ a: 1 }, { a: 2 }, { a: 3 });

proxify(source)
  .a // read `a` from every emission
  .subscribe(rxObserver());
0msstartcomplete11 22 33

Call methods

Call methods on stream values, preserving this binding:

1
2
3
4
5
6
7
8
9
10
const { rxObserver } = require('api/v0.3');
const { timer } = require('rxjs');
const { proxify } = require('rxjs-proxify');

const a = timer(0, 100);

proxify(a)
  .toString(2)
  .subscribe(rxObserver());
⚠️ Execution time is limited to 1000ms
0msstart00 11 1010 1111 100100 101101 110110 111111 10001000 10011001 10101010

🛠 Check out the docs for more: github.com/kosich/rxjs-proxify

This is one of my libs that I'd like to share with you