@rededor/site-front-end-lib 20.0.3 → 20.0.4
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.
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TransferState, makeStateKey, Injectable } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class TransferStateService {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.transferState = inject(TransferState);
|
|
7
|
+
this.keys = new Map();
|
|
8
|
+
}
|
|
9
|
+
setKey(name, response) {
|
|
10
|
+
let key = this.keys.get(name);
|
|
11
|
+
if (!key) {
|
|
12
|
+
key = makeStateKey(name);
|
|
13
|
+
this.keys.set(name, key);
|
|
14
|
+
}
|
|
15
|
+
this.transferState.set(key, response);
|
|
16
|
+
}
|
|
17
|
+
getKey(name, defaultValue = null) {
|
|
18
|
+
let key = this.keys.get(name);
|
|
19
|
+
if (!key) {
|
|
20
|
+
key = makeStateKey(name);
|
|
21
|
+
this.keys.set(name, key);
|
|
22
|
+
}
|
|
23
|
+
const response = this.transferState.get(key, defaultValue);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
remove(name) {
|
|
27
|
+
let key = this.keys.get(name);
|
|
28
|
+
if (!key) {
|
|
29
|
+
key = makeStateKey(name);
|
|
30
|
+
this.keys.set(name, key);
|
|
31
|
+
}
|
|
32
|
+
this.transferState.remove(key);
|
|
33
|
+
}
|
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TransferStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
35
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TransferStateService, providedIn: 'root' }); }
|
|
36
|
+
}
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TransferStateService, decorators: [{
|
|
38
|
+
type: Injectable,
|
|
39
|
+
args: [{
|
|
40
|
+
providedIn: 'root',
|
|
41
|
+
}]
|
|
42
|
+
}] });
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Generated bundle index. Do not edit.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
export { TransferStateService };
|
|
49
|
+
//# sourceMappingURL=rededor-site-front-end-lib-services-transfer-state.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-services-transfer-state.mjs","sources":["../../../projects/site-front-end-lib/services/transfer-state/transfer-state.service.ts","../../../projects/site-front-end-lib/services/transfer-state/rededor-site-front-end-lib-services-transfer-state.ts"],"sourcesContent":["import { inject, Injectable, makeStateKey, StateKey, TransferState } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransferStateService {\n private transferState = inject(TransferState);\n\n private keys = new Map<string, StateKey<string>>();\n\n setKey(name: any, response: any | any[]) {\n let key = this.keys.get(name);\n if (!key) {\n key = makeStateKey(name);\n this.keys.set(name, key);\n }\n this.transferState.set(key, response);\n }\n\n getKey(name: string, defaultValue: any | any[] = null): any | any[] {\n let key = this.keys.get(name);\n if (!key) {\n key = makeStateKey(name);\n this.keys.set(name, key);\n }\n const response = this.transferState.get(key, defaultValue);\n return response;\n }\n\n remove(name: string) {\n let key = this.keys.get(name);\n if (!key) {\n key = makeStateKey(name);\n this.keys.set(name, key);\n }\n this.transferState.remove(key);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,oBAAoB,CAAA;AAHjC,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AAErC,QAAA,IAAA,CAAA,IAAI,GAAG,IAAI,GAAG,EAA4B;AA6BnD,IAAA;IA3BC,MAAM,CAAC,IAAS,EAAE,QAA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AAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFnB,MAAM,EAAA,CAAA,CAAA;;4FAEP,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rededor/site-front-end-lib",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.0.0",
|
|
6
6
|
"@angular/core": "^20.0.0",
|
|
@@ -313,6 +313,10 @@
|
|
|
313
313
|
"types": "./services/ssr-loading/index.d.ts",
|
|
314
314
|
"default": "./fesm2022/rededor-site-front-end-lib-services-ssr-loading.mjs"
|
|
315
315
|
},
|
|
316
|
+
"./services/transfer-state": {
|
|
317
|
+
"types": "./services/transfer-state/index.d.ts",
|
|
318
|
+
"default": "./fesm2022/rededor-site-front-end-lib-services-transfer-state.mjs"
|
|
319
|
+
},
|
|
316
320
|
"./services/youtube": {
|
|
317
321
|
"types": "./services/youtube/index.d.ts",
|
|
318
322
|
"default": "./fesm2022/rededor-site-front-end-lib-services-youtube.mjs"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class TransferStateService {
|
|
4
|
+
private transferState;
|
|
5
|
+
private keys;
|
|
6
|
+
setKey(name: any, response: any | any[]): void;
|
|
7
|
+
getKey(name: string, defaultValue?: any | any[]): any | any[];
|
|
8
|
+
remove(name: string): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TransferStateService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TransferStateService>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { TransferStateService };
|