DEV Community

Discussion on: What was your win this week?

Collapse
 
kosich profile image
Kostia Palchyk

I've published npm package to make queries to RxJS streams


AB*C
[A --a--------]
[B -b-b-b-b-b-]
[C --------c--]
[= --ab-b-bc| ]

Reactive Query Language

📖 Intro

Extract events from multiple streams using query commands

📦 Install

npm i rx-rql

Or try it online

🔧 API

Query root

Your query should be wrapped in a query or $ function

query(A, B, C).subscribe(console.log);

It returns an Observable of query results!

A, B, C — single emission

To select a single event from a stream — just pass that stream to the query function or one of the operators:

// $ A
// A ---Hi-----
// = ---(H|)
const A = of('H', 'i');
query(A).subscribe(console.log); // > H
// $ AA
// A ---Hi-----
// = ---H(i|)
query(A, A).

that wasn't easy

Collapse
 
stereoplegic profile image
Mike Bybee

Nice!