This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EMPTY } from "rxjs"; | |
import { first } from "rxjs/operators"; | |
EMPTY.pipe(first()).subscribe({ error: console.warn }); | |
// (synchronously) EmptyErrorImpl | |
// v6.6.7 has no call stack, but v7 does |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { connectable, interval, merge, of, Subject, zip } from "rxjs"; | |
import { filter, map } from "rxjs/operators"; | |
const chars$ = zip(interval(1000), of("A", "b", "C", "D", "e", "f", "G")).pipe( | |
map(([, char]) => char) | |
); | |
const connectableChars$ = connectable(chars$, { | |
connector: () => new Subject(), | |
resetOnDisconnect: true | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Note: This is just for fun. | |
*/ | |
type Split<T extends string, Delimiter extends string = ""> = | |
"" extends T | |
? [] | |
: T extends `${infer Head}${Delimiter}${infer Tail}` | |
? [Head, ...Split<Tail, Delimiter>] | |
: [T]; |
OlderNewer