skip to content

rxjs-rql

 

📖 About

Reactive Query Language for RxJS

🔗 Links:
See the homepage: github.com/erql/rx-rql
Read an intro article: "Queries for Observables: Crazy & Simple!"

📦 Install:

npm i rx-rql

🛸 Examples

Simple Query

Query events that occurred between other events

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const { rxObserver } = require('api/v0.3');
const { timer } = require('rxjs');
const { mapTo } = require('rxjs/operators');
const { query, some, mute } = require('rx-rql');

const a = timer(200).pipe(mapTo('a'));
const b = timer(0, 50).pipe(mapTo('b'));
const c = timer(800).pipe(mapTo('c'));

a.subscribe(rxObserver('a'));
b.subscribe(rxObserver('b'));
c.subscribe(rxObserver('c'));

// select all B between A and C
query(
  some(mute(a), some(b), mute(c))
)
.subscribe(rxObserver('all B between A and C'));
⚠️ Execution time is limited to 1000ms
0msastartcompleteaa bstartbb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb cstartcompletecc all B between A and Cstartbb bb bb bb bb bb bb bb bb bb bb bb

🛠 Check out the docs for more: github.com/erql/rx-rql

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