rzjs 0.2.1 → 0.3.1

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 CHANGED
@@ -103,6 +103,7 @@ export { webSocket } from "rxjs/webSocket";
103
103
 
104
104
  export { log } from "./operators/log";
105
105
  export { debug, step } from "./operators/debug";
106
+ export { switchTo } from "./operators/switchTo";
106
107
 
107
108
  export type {
108
109
  WebSocketSubject,
@@ -1,8 +1,11 @@
1
1
  import { tap } from 'rxjs';
2
2
 
3
- export const debug = <T>(prefix?: string) => tap<T>(data => {
4
- data; // hover this
5
- debugger;
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,9 @@
1
+ /**
2
+ * Switch to another stream when anything is received
3
+ *
4
+ * N.B.: Just like switchMap, this will cause the supplied stream to be restarted
5
+ */
6
+ export const switchTo = <T>(target: Observable<T>) =>
7
+ switchMap(() => target)
8
+ ;
9
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rzjs",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
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",