@polkadot/rpc-core 9.2.3 → 9.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/cjs/packageInfo.js +1 -1
- package/cjs/util/drr.js +15 -17
- package/package.json +5 -5
- package/packageInfo.js +1 -1
- package/util/drr.d.ts +1 -1
- package/util/drr.js +16 -13
package/cjs/packageInfo.js
CHANGED
package/cjs/util/drr.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.drr =
|
|
6
|
+
exports.drr = drr;
|
|
7
7
|
|
|
8
8
|
var _rxjs = require("rxjs");
|
|
9
9
|
|
|
@@ -13,20 +13,20 @@ var _refCountDelay = require("./refCountDelay");
|
|
|
13
13
|
|
|
14
14
|
// Copyright 2017-2022 @polkadot/rpc-core authors & contributors
|
|
15
15
|
// SPDX-License-Identifier: Apache-2.0
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
l.error(error.message);
|
|
16
|
+
function CMP(a, b) {
|
|
17
|
+
return (0, _util.stringify)({
|
|
18
|
+
t: a
|
|
19
|
+
}) === (0, _util.stringify)({
|
|
20
|
+
t: b
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function ERR(error) {
|
|
26
25
|
throw error;
|
|
27
|
-
}
|
|
26
|
+
}
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
function NOOP() {// empty
|
|
29
|
+
}
|
|
30
30
|
/**
|
|
31
31
|
* Shorthand for distinctUntilChanged(), publishReplay(1) and refCount().
|
|
32
32
|
*
|
|
@@ -35,13 +35,11 @@ const NOOP = () => undefined;
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
function drr() {
|
|
39
39
|
let {
|
|
40
40
|
delay,
|
|
41
41
|
skipChange = false,
|
|
42
42
|
skipTimeout = false
|
|
43
43
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
44
44
|
return source$ => source$.pipe((0, _rxjs.catchError)(ERR), skipChange ? (0, _rxjs.tap)(NOOP) : (0, _rxjs.distinctUntilChanged)(CMP), (0, _rxjs.publishReplay)(1), skipTimeout ? (0, _rxjs.refCount)() : (0, _refCountDelay.refCountDelay)(delay));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
exports.drr = drr;
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./cjs/detectPackage.js"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "9.2
|
|
23
|
+
"version": "9.3.2",
|
|
24
24
|
"main": "./cjs/index.js",
|
|
25
25
|
"module": "./index.js",
|
|
26
26
|
"types": "./index.d.ts",
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"@babel/runtime": "^7.18.9",
|
|
99
|
-
"@polkadot/rpc-augment": "9.2
|
|
100
|
-
"@polkadot/rpc-provider": "9.2
|
|
101
|
-
"@polkadot/types": "9.2
|
|
102
|
-
"@polkadot/util": "^10.1.
|
|
99
|
+
"@polkadot/rpc-augment": "9.3.2",
|
|
100
|
+
"@polkadot/rpc-provider": "9.3.2",
|
|
101
|
+
"@polkadot/types": "9.3.2",
|
|
102
|
+
"@polkadot/util": "^10.1.7",
|
|
103
103
|
"rxjs": "^7.5.6"
|
|
104
104
|
}
|
|
105
105
|
}
|
package/packageInfo.js
CHANGED
|
@@ -5,5 +5,5 @@ export const packageInfo = {
|
|
|
5
5
|
name: '@polkadot/rpc-core',
|
|
6
6
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
7
7
|
type: 'esm',
|
|
8
|
-
version: '9.2
|
|
8
|
+
version: '9.3.2'
|
|
9
9
|
};
|
package/util/drr.d.ts
CHANGED
package/util/drr.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/rpc-core authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { catchError, distinctUntilChanged, publishReplay, refCount, tap } from 'rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { stringify } from '@polkadot/util';
|
|
5
5
|
import { refCountDelay } from "./refCountDelay.js";
|
|
6
|
-
const l = logger('drr');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
function CMP(a, b) {
|
|
8
|
+
return stringify({
|
|
9
|
+
t: a
|
|
10
|
+
}) === stringify({
|
|
11
|
+
t: b
|
|
12
|
+
});
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
l.error(error.message);
|
|
15
|
+
function ERR(error) {
|
|
16
16
|
throw error;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
function NOOP() {// empty
|
|
20
|
+
}
|
|
20
21
|
/**
|
|
21
22
|
* Shorthand for distinctUntilChanged(), publishReplay(1) and refCount().
|
|
22
23
|
*
|
|
@@ -25,8 +26,10 @@ const NOOP = () => undefined;
|
|
|
25
26
|
*/
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
export
|
|
29
|
+
export function drr({
|
|
29
30
|
delay,
|
|
30
31
|
skipChange = false,
|
|
31
32
|
skipTimeout = false
|
|
32
|
-
} = {})
|
|
33
|
+
} = {}) {
|
|
34
|
+
return source$ => source$.pipe(catchError(ERR), skipChange ? tap(NOOP) : distinctUntilChanged(CMP), publishReplay(1), skipTimeout ? refCount() : refCountDelay(delay));
|
|
35
|
+
}
|