rzjs 0.2.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +1 -0
- package/operators/debug.ts +7 -4
- package/operators/switchTo.ts +11 -0
- package/package.json +2 -1
package/index.ts
CHANGED
package/operators/debug.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { tap } from 'rxjs';
|
|
2
2
|
|
|
3
|
-
export const debug = <T>(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export const debug = <T>(name?: string) =>
|
|
4
|
+
tap<T>(data => {
|
|
5
|
+
name; // the name of the current breakpoint
|
|
6
|
+
data; // the data; hover this to inspect
|
|
7
|
+
debugger;
|
|
8
|
+
})
|
|
9
|
+
;
|
|
7
10
|
|
|
8
11
|
export const step = debug;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { switchMap } from "rxjs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Switch to another stream when anything is received
|
|
5
|
+
*
|
|
6
|
+
* N.B.: Just like switchMap, this will cause the supplied stream to be restarted
|
|
7
|
+
*/
|
|
8
|
+
export const switchTo = <T>(target: Observable<T>) =>
|
|
9
|
+
switchMap(() => target)
|
|
10
|
+
;
|
|
11
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rzjs",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "RxJS repackaged for Stream-Oriented Programming",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"observable",
|
|
16
16
|
"reactive",
|
|
17
17
|
"stream",
|
|
18
|
+
"sop",
|
|
18
19
|
"sp",
|
|
19
20
|
"stream-oriented",
|
|
20
21
|
"stream-oriented programming",
|