@dereekb/rxjs 9.7.1 → 9.7.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/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/lib/rxjs/index.d.ts +1 -0
- package/src/lib/rxjs/index.js +1 -0
- package/src/lib/rxjs/index.js.map +1 -1
- package/src/lib/rxjs/key.d.ts +8 -0
- package/src/lib/rxjs/key.js +29 -0
- package/src/lib/rxjs/key.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.7.2](https://github.com/dereekb/dbx-components/compare/v9.7.1-dev...v9.7.2) (2022-09-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [9.7.1](https://github.com/dereekb/dbx-components/compare/v9.7.0-dev...v9.7.1) (2022-09-06)
|
|
6
10
|
|
|
7
11
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/rxjs",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
9
|
"rxjs": "^7.5.0",
|
|
10
|
-
"@dereekb/util": "9.7.
|
|
10
|
+
"@dereekb/util": "9.7.2",
|
|
11
11
|
"lodash.isequal": "^4.5.0",
|
|
12
12
|
"make-error": "^1.3.0",
|
|
13
13
|
"ts-essentials": "^9.1.2",
|
package/src/lib/rxjs/index.d.ts
CHANGED
package/src/lib/rxjs/index.js
CHANGED
|
@@ -7,6 +7,7 @@ tslib_1.__exportStar(require("./delta"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./timeout"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./factory"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./getter"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./key"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./lifecycle"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./loading"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./misc"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/rxjs/src/lib/rxjs/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,kDAAwB;AACxB,oDAA0B;AAC1B,oDAA0B;AAC1B,mDAAyB;AACzB,sDAA4B;AAC5B,oDAA0B;AAC1B,iDAAuB;AACvB,gDAAsB;AACtB,mDAAyB;AACzB,iDAAuB;AACvB,uDAA6B;AAC7B,qDAA2B;AAC3B,gDAAsB;AACtB,gDAAsB;AACtB,kDAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/rxjs/src/lib/rxjs/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,kDAAwB;AACxB,oDAA0B;AAC1B,oDAA0B;AAC1B,mDAAyB;AACzB,gDAAsB;AACtB,sDAA4B;AAC5B,oDAA0B;AAC1B,iDAAuB;AACvB,gDAAsB;AACtB,mDAAyB;AACzB,iDAAuB;AACvB,uDAA6B;AAC7B,qDAA2B;AAC3B,gDAAsB;AACtB,gDAAsB;AACtB,kDAAwB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PrimativeKey, ReadKeyFunction, ReadMultipleKeysFunction } from '@dereekb/util';
|
|
2
|
+
import { MonoTypeOperatorFunction } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* distinctUntilChanged() that reads the unique identifiers from the input values and compares them for uniqueness.
|
|
5
|
+
*
|
|
6
|
+
* @param readkey
|
|
7
|
+
*/
|
|
8
|
+
export declare function distinctUntilKeysChange<T, K extends PrimativeKey = PrimativeKey>(readKey: ReadKeyFunction<T, K> | ReadMultipleKeysFunction<T, K>): MonoTypeOperatorFunction<T[]>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.distinctUntilKeysChange = void 0;
|
|
4
|
+
const util_1 = require("@dereekb/util");
|
|
5
|
+
const rxjs_1 = require("rxjs");
|
|
6
|
+
/**
|
|
7
|
+
* distinctUntilChanged() that reads the unique identifiers from the input values and compares them for uniqueness.
|
|
8
|
+
*
|
|
9
|
+
* @param readkey
|
|
10
|
+
*/
|
|
11
|
+
function distinctUntilKeysChange(readKey) {
|
|
12
|
+
const readKeysSet = (0, util_1.readKeysSetFunction)(readKey);
|
|
13
|
+
const readKeysArray = (0, util_1.readKeysFunction)(readKey);
|
|
14
|
+
return (0, rxjs_1.distinctUntilChanged)((a, b) => {
|
|
15
|
+
if (a.length === b.length) {
|
|
16
|
+
if (a.length === 0) {
|
|
17
|
+
return true; // both the same/empty arrays
|
|
18
|
+
}
|
|
19
|
+
const aKeys = readKeysSet(a);
|
|
20
|
+
const bKeys = readKeysArray(b);
|
|
21
|
+
if (aKeys.size === bKeys.length) {
|
|
22
|
+
return (0, util_1.setContainsAllValues)(aKeys, bKeys);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.distinctUntilKeysChange = distinctUntilKeysChange;
|
|
29
|
+
//# sourceMappingURL=key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.js","sourceRoot":"","sources":["../../../../../../packages/rxjs/src/lib/rxjs/key.ts"],"names":[],"mappings":";;;AAAA,wCAAiN;AACjN,+BAAsE;AAEtE;;;;GAIG;AACH,SAAgB,uBAAuB,CAA2C,OAA+D;IAC/I,MAAM,WAAW,GAAG,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,IAAA,uBAAgB,EAAC,OAAO,CAAC,CAAC;IAEhD,OAAO,IAAA,2BAAoB,EAAC,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE;QAC7C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;YACzB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAClB,OAAO,IAAI,CAAC,CAAC,6BAA6B;aAC3C;YAED,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAC7B,MAAM,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,EAAE;gBAC/B,OAAO,IAAA,2BAAoB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAC3C;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AApBD,0DAoBC"}
|