@donmahallem/rxjs-zone 0.3.7 → 0.3.13
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/dist/cjs/index.js
CHANGED
|
@@ -5,72 +5,72 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const core = require('@angular/core');
|
|
6
6
|
const rxjs = require('rxjs');
|
|
7
7
|
|
|
8
|
-
/*
|
|
9
|
-
* Package @donmahallem/rxjs-zone
|
|
10
|
-
* Source https://donmahallem.github.io/js-libs/
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Runs the provided observable in the NgZone
|
|
14
|
-
*
|
|
15
|
-
* @param {import('@angular/core').NgZone} zone Zone to run in
|
|
16
|
-
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data in the zone
|
|
17
|
-
*/
|
|
18
|
-
function runInsideZone(zone) {
|
|
19
|
-
return (source) => new rxjs.Observable((observer) => source.subscribe({
|
|
20
|
-
complete() {
|
|
21
|
-
observer.complete();
|
|
22
|
-
},
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
-
error(err) {
|
|
25
|
-
observer.error(err);
|
|
26
|
-
},
|
|
27
|
-
next(x) {
|
|
28
|
-
if (core.NgZone.isInAngularZone()) {
|
|
29
|
-
observer.next(x);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
zone.run(() => {
|
|
33
|
-
observer.next(x);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
}));
|
|
8
|
+
/*
|
|
9
|
+
* Package @donmahallem/rxjs-zone
|
|
10
|
+
* Source https://donmahallem.github.io/js-libs/
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Runs the provided observable in the NgZone
|
|
14
|
+
*
|
|
15
|
+
* @param {import('@angular/core').NgZone} zone Zone to run in
|
|
16
|
+
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data in the zone
|
|
17
|
+
*/
|
|
18
|
+
function runInsideZone(zone) {
|
|
19
|
+
return (source) => new rxjs.Observable((observer) => source.subscribe({
|
|
20
|
+
complete() {
|
|
21
|
+
observer.complete();
|
|
22
|
+
},
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
error(err) {
|
|
25
|
+
observer.error(err);
|
|
26
|
+
},
|
|
27
|
+
next(x) {
|
|
28
|
+
if (core.NgZone.isInAngularZone()) {
|
|
29
|
+
observer.next(x);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
zone.run(() => {
|
|
33
|
+
observer.next(x);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/*
|
|
41
|
-
* Package @donmahallem/rxjs-zone
|
|
42
|
-
* Source https://donmahallem.github.io/js-libs/
|
|
43
|
-
*/
|
|
44
|
-
/**
|
|
45
|
-
* Runs the provided observable outside the NgZone
|
|
46
|
-
*
|
|
47
|
-
* @param {import('@angular/core').NgZone} zone Zone to run outside of
|
|
48
|
-
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data outside the zone
|
|
49
|
-
*/
|
|
50
|
-
function runOutsideZone(zone) {
|
|
51
|
-
return (source) => new rxjs.Observable((observer) => source.subscribe({
|
|
52
|
-
complete() {
|
|
53
|
-
observer.complete();
|
|
54
|
-
},
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
-
error(err) {
|
|
57
|
-
observer.error(err);
|
|
58
|
-
},
|
|
59
|
-
next(x) {
|
|
60
|
-
if (core.NgZone.isInAngularZone()) {
|
|
61
|
-
zone.runOutsideAngular(() => {
|
|
62
|
-
observer.next(x);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
observer.next(x);
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
}));
|
|
40
|
+
/*
|
|
41
|
+
* Package @donmahallem/rxjs-zone
|
|
42
|
+
* Source https://donmahallem.github.io/js-libs/
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Runs the provided observable outside the NgZone
|
|
46
|
+
*
|
|
47
|
+
* @param {import('@angular/core').NgZone} zone Zone to run outside of
|
|
48
|
+
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data outside the zone
|
|
49
|
+
*/
|
|
50
|
+
function runOutsideZone(zone) {
|
|
51
|
+
return (source) => new rxjs.Observable((observer) => source.subscribe({
|
|
52
|
+
complete() {
|
|
53
|
+
observer.complete();
|
|
54
|
+
},
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
+
error(err) {
|
|
57
|
+
observer.error(err);
|
|
58
|
+
},
|
|
59
|
+
next(x) {
|
|
60
|
+
if (core.NgZone.isInAngularZone()) {
|
|
61
|
+
zone.runOutsideAngular(() => {
|
|
62
|
+
observer.next(x);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
observer.next(x);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
}));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
exports.runInsideZone = runInsideZone;
|
|
73
73
|
exports.runOutsideZone = runOutsideZone;
|
|
74
|
-
// BUILD:
|
|
74
|
+
// BUILD: Wed Mar 02 2022 21:27:04 GMT+0000 (Coordinated Universal Time)
|
|
75
75
|
|
|
76
76
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
import { NgZone } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
|
|
4
|
-
/*
|
|
5
|
-
* Package @donmahallem/rxjs-zone
|
|
6
|
-
* Source https://donmahallem.github.io/js-libs/
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Runs the provided observable in the NgZone
|
|
10
|
-
*
|
|
11
|
-
* @param {import('@angular/core').NgZone} zone Zone to run in
|
|
12
|
-
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data in the zone
|
|
13
|
-
*/
|
|
14
|
-
function runInsideZone(zone) {
|
|
15
|
-
return (source) => new Observable((observer) => source.subscribe({
|
|
16
|
-
complete() {
|
|
17
|
-
observer.complete();
|
|
18
|
-
},
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
-
error(err) {
|
|
21
|
-
observer.error(err);
|
|
22
|
-
},
|
|
23
|
-
next(x) {
|
|
24
|
-
if (NgZone.isInAngularZone()) {
|
|
25
|
-
observer.next(x);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
zone.run(() => {
|
|
29
|
-
observer.next(x);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
}));
|
|
4
|
+
/*
|
|
5
|
+
* Package @donmahallem/rxjs-zone
|
|
6
|
+
* Source https://donmahallem.github.io/js-libs/
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Runs the provided observable in the NgZone
|
|
10
|
+
*
|
|
11
|
+
* @param {import('@angular/core').NgZone} zone Zone to run in
|
|
12
|
+
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data in the zone
|
|
13
|
+
*/
|
|
14
|
+
function runInsideZone(zone) {
|
|
15
|
+
return (source) => new Observable((observer) => source.subscribe({
|
|
16
|
+
complete() {
|
|
17
|
+
observer.complete();
|
|
18
|
+
},
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
error(err) {
|
|
21
|
+
observer.error(err);
|
|
22
|
+
},
|
|
23
|
+
next(x) {
|
|
24
|
+
if (NgZone.isInAngularZone()) {
|
|
25
|
+
observer.next(x);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
zone.run(() => {
|
|
29
|
+
observer.next(x);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
}));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/*
|
|
37
|
-
* Package @donmahallem/rxjs-zone
|
|
38
|
-
* Source https://donmahallem.github.io/js-libs/
|
|
39
|
-
*/
|
|
40
|
-
/**
|
|
41
|
-
* Runs the provided observable outside the NgZone
|
|
42
|
-
*
|
|
43
|
-
* @param {import('@angular/core').NgZone} zone Zone to run outside of
|
|
44
|
-
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data outside the zone
|
|
45
|
-
*/
|
|
46
|
-
function runOutsideZone(zone) {
|
|
47
|
-
return (source) => new Observable((observer) => source.subscribe({
|
|
48
|
-
complete() {
|
|
49
|
-
observer.complete();
|
|
50
|
-
},
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
-
error(err) {
|
|
53
|
-
observer.error(err);
|
|
54
|
-
},
|
|
55
|
-
next(x) {
|
|
56
|
-
if (NgZone.isInAngularZone()) {
|
|
57
|
-
zone.runOutsideAngular(() => {
|
|
58
|
-
observer.next(x);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
observer.next(x);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
}));
|
|
36
|
+
/*
|
|
37
|
+
* Package @donmahallem/rxjs-zone
|
|
38
|
+
* Source https://donmahallem.github.io/js-libs/
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Runs the provided observable outside the NgZone
|
|
42
|
+
*
|
|
43
|
+
* @param {import('@angular/core').NgZone} zone Zone to run outside of
|
|
44
|
+
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data outside the zone
|
|
45
|
+
*/
|
|
46
|
+
function runOutsideZone(zone) {
|
|
47
|
+
return (source) => new Observable((observer) => source.subscribe({
|
|
48
|
+
complete() {
|
|
49
|
+
observer.complete();
|
|
50
|
+
},
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
error(err) {
|
|
53
|
+
observer.error(err);
|
|
54
|
+
},
|
|
55
|
+
next(x) {
|
|
56
|
+
if (NgZone.isInAngularZone()) {
|
|
57
|
+
zone.runOutsideAngular(() => {
|
|
58
|
+
observer.next(x);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
observer.next(x);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export { runInsideZone, runOutsideZone };
|
|
69
|
-
// BUILD:
|
|
69
|
+
// BUILD: Wed Mar 02 2022 21:27:04 GMT+0000 (Coordinated Universal Time)
|
|
70
70
|
|
|
71
71
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { runInsideZone } from './run-inside-zone';
|
|
2
|
-
export { runOutsideZone } from './run-outside-zone';
|
|
1
|
+
export { runInsideZone } from './run-inside-zone';
|
|
2
|
+
export { runOutsideZone } from './run-outside-zone';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import 'mocha';
|
|
1
|
+
import 'mocha';
|
|
2
2
|
//# sourceMappingURL=index.spec.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NgZone } from '@angular/core';
|
|
2
|
-
import type { MonoTypeOperatorFunction } from 'rxjs';
|
|
3
|
-
/**
|
|
4
|
-
* Runs the provided observable in the NgZone
|
|
5
|
-
*
|
|
6
|
-
* @param {import('@angular/core').NgZone} zone Zone to run in
|
|
7
|
-
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data in the zone
|
|
8
|
-
*/
|
|
9
|
-
export declare function runInsideZone<T>(zone: NgZone): MonoTypeOperatorFunction<T>;
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import type { MonoTypeOperatorFunction } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* Runs the provided observable in the NgZone
|
|
5
|
+
*
|
|
6
|
+
* @param {import('@angular/core').NgZone} zone Zone to run in
|
|
7
|
+
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data in the zone
|
|
8
|
+
*/
|
|
9
|
+
export declare function runInsideZone<T>(zone: NgZone): MonoTypeOperatorFunction<T>;
|
|
10
10
|
//# sourceMappingURL=run-inside-zone.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NgZone } from '@angular/core';
|
|
2
|
-
import type { MonoTypeOperatorFunction } from 'rxjs';
|
|
3
|
-
/**
|
|
4
|
-
* Runs the provided observable outside the NgZone
|
|
5
|
-
*
|
|
6
|
-
* @param {import('@angular/core').NgZone} zone Zone to run outside of
|
|
7
|
-
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data outside the zone
|
|
8
|
-
*/
|
|
9
|
-
export declare function runOutsideZone<T>(zone: NgZone): MonoTypeOperatorFunction<T>;
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import type { MonoTypeOperatorFunction } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* Runs the provided observable outside the NgZone
|
|
5
|
+
*
|
|
6
|
+
* @param {import('@angular/core').NgZone} zone Zone to run outside of
|
|
7
|
+
* @returns {import('rxjs').MonoTypeOperatorFunction<T>} passes on data outside the zone
|
|
8
|
+
*/
|
|
9
|
+
export declare function runOutsideZone<T>(zone: NgZone): MonoTypeOperatorFunction<T>;
|
|
10
10
|
//# sourceMappingURL=run-outside-zone.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donmahallem/rxjs-zone",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Helper for handling zone.js with rxjs",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@angular/core": "13.2.
|
|
61
|
-
"rxjs": "7.5.
|
|
60
|
+
"@angular/core": "13.2.5",
|
|
61
|
+
"rxjs": "7.5.4"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@angular/core": "<14.0.0",
|
|
65
65
|
"rxjs": "<8.0.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "e835534489fb59116bbb4c9d231610eb94f9f12f"
|
|
68
68
|
}
|