ngssm-store 15.3.7 → 15.3.8
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/esm2020/lib/logging/console-appender.mjs +16 -6
- package/esm2020/lib/logging/logger.mjs +3 -3
- package/esm2020/lib/ngssm-component.mjs +3 -3
- package/esm2020/lib/store.mjs +3 -3
- package/esm2020/public-api.mjs +1 -2
- package/fesm2015/ngssm-store.mjs +25 -30
- package/fesm2015/ngssm-store.mjs.map +1 -1
- package/fesm2020/ngssm-store.mjs +25 -30
- package/fesm2020/ngssm-store.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/esm2020/lib/ngssm-store.module.mjs +0 -16
- package/lib/ngssm-store.module.d.ts +0 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
2
|
import { Subject, takeUntil } from 'rxjs';
|
|
3
|
+
import { LogLevel } from './log-level';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
import * as i1 from "./logger";
|
|
5
6
|
export class ConsoleAppender {
|
|
@@ -9,11 +10,20 @@ export class ConsoleAppender {
|
|
|
9
10
|
}
|
|
10
11
|
start() {
|
|
11
12
|
this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {
|
|
13
|
+
let logFunction;
|
|
14
|
+
switch (logEvent.level) {
|
|
15
|
+
case LogLevel.error:
|
|
16
|
+
logFunction = console.error;
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
logFunction = console.log;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
12
22
|
if (logEvent.payload) {
|
|
13
|
-
|
|
23
|
+
logFunction(`[${logEvent.level}] ${logEvent.message}`, logEvent.payload);
|
|
14
24
|
}
|
|
15
25
|
else {
|
|
16
|
-
|
|
26
|
+
logFunction(`[${logEvent.level}] ${logEvent.message}`);
|
|
17
27
|
}
|
|
18
28
|
});
|
|
19
29
|
}
|
|
@@ -21,12 +31,12 @@ export class ConsoleAppender {
|
|
|
21
31
|
this.stopEvent$.next(true);
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
|
-
ConsoleAppender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
25
|
-
ConsoleAppender.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
34
|
+
ConsoleAppender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, deps: [{ token: i1.Logger }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
+
ConsoleAppender.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, providedIn: 'root' });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, decorators: [{
|
|
27
37
|
type: Injectable,
|
|
28
38
|
args: [{
|
|
29
39
|
providedIn: 'root'
|
|
30
40
|
}]
|
|
31
41
|
}], ctorParameters: function () { return [{ type: i1.Logger }]; } });
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc29sZS1hcHBlbmRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25nc3NtLXN0b3JlL3NyYy9saWIvbG9nZ2luZy9jb25zb2xlLWFwcGVuZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLE9BQU8sRUFBRS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ICAgICBicmVhaztcbiAgICAgIH1cblxuICAgICAgaWYgKGxvZ0V2ZW50LnBheWxvYWQpIHtcbiAgICAgICAgbG9nRnVuY3Rpb24oYFske2xvZ0V2ZW50LmxldmVsfV0gJHtsb2dFdmVudC5tZXNzYWdlfWAsIGxvZ0V2ZW50LnBheWxvYWQpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbG9nRnVuY3Rpb24oYFske2xvZ0V2ZW50LmxldmVsfV0gJHtsb2dFdmVudC5tZXNzYWdlfWApO1xuICAgICAgfVxuICAgIH0pO1xuICB9XG5cbiAgcHVibGljIHN0b3AoKTogdm9pZCB7XG4gICAgdGhpcy5zdG9wRXZlbnQkLm5leHQodHJ1ZSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -26,9 +26,9 @@ export class Logger {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
Logger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
30
|
-
Logger.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
29
|
+
Logger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
30
|
+
Logger.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, providedIn: 'root' });
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, decorators: [{
|
|
32
32
|
type: Injectable,
|
|
33
33
|
args: [{
|
|
34
34
|
providedIn: 'root'
|
|
@@ -24,9 +24,9 @@ export class NgSsmComponent {
|
|
|
24
24
|
this.store.dispatchActionType(actionType);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
NgSsmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
28
|
-
NgSsmComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
27
|
+
NgSsmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: NgSsmComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive });
|
|
28
|
+
NgSsmComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.6", type: NgSsmComponent, ngImport: i0 });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: NgSsmComponent, decorators: [{
|
|
30
30
|
type: Directive,
|
|
31
31
|
args: [{}]
|
|
32
32
|
}], ctorParameters: function () { return [{ type: i1.Store }]; } });
|
package/esm2020/lib/store.mjs
CHANGED
|
@@ -104,9 +104,9 @@ export class Store {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
Store.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
108
|
-
Store.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
107
|
+
Store.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, deps: [{ token: i1.Logger }, { token: NGSSM_REDUCER, optional: true }, { token: NGSSM_EFFECT, optional: true }, { token: NGSSM_STATE_INITIALIZER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
108
|
+
Store.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, providedIn: 'root' });
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, decorators: [{
|
|
110
110
|
type: Injectable,
|
|
111
111
|
args: [{
|
|
112
112
|
providedIn: 'root'
|
package/esm2020/public-api.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Public API Surface of ngssm-store
|
|
3
3
|
*/
|
|
4
|
-
export * from './lib/ngssm-store.module';
|
|
5
4
|
export * from './lib/store';
|
|
6
5
|
export * from './lib/state';
|
|
7
6
|
export * from './lib/action';
|
|
@@ -12,4 +11,4 @@ export * from './lib/ngssm-component';
|
|
|
12
11
|
export * from './lib/state-initializer';
|
|
13
12
|
export * from './lib/logging';
|
|
14
13
|
export * from './lib/store-mock';
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25nc3NtLXN0b3JlL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxtQ0FBbUMsQ0FBQztBQUNsRCxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxrQkFBa0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbmdzc20tc3RvcmVcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdG9yZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdGF0ZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9hY3Rpb24nO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvcmVkdWNlcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9lZmZlY3QnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZmVhdHVyZS1zdGF0ZS1zcGVjaWZpY2F0aW9uJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL25nc3NtLWNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdGF0ZS1pbml0aWFsaXplcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9sb2dnaW5nJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3N0b3JlLW1vY2snO1xuIl19
|
package/fesm2015/ngssm-store.mjs
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { InjectionToken, Injectable, Inject, Optional, Directive } from '@angular/core';
|
|
3
3
|
import { Subject, takeUntil, BehaviorSubject, map, distinctUntilChanged } from 'rxjs';
|
|
4
4
|
import update from 'immutability-helper';
|
|
5
5
|
|
|
6
|
-
class NgssmStoreModule {
|
|
7
|
-
}
|
|
8
|
-
NgssmStoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
-
NgssmStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule });
|
|
10
|
-
NgssmStoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule });
|
|
11
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule, decorators: [{
|
|
12
|
-
type: NgModule,
|
|
13
|
-
args: [{
|
|
14
|
-
declarations: [],
|
|
15
|
-
imports: [],
|
|
16
|
-
exports: []
|
|
17
|
-
}]
|
|
18
|
-
}] });
|
|
19
|
-
|
|
20
6
|
const NGSSM_REDUCER = new InjectionToken('NGSSM_REDUCER');
|
|
21
7
|
|
|
22
8
|
const NGSSM_EFFECT = new InjectionToken('NGSSM_EFFECT');
|
|
@@ -54,9 +40,9 @@ class Logger {
|
|
|
54
40
|
});
|
|
55
41
|
}
|
|
56
42
|
}
|
|
57
|
-
Logger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
58
|
-
Logger.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
43
|
+
Logger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
+
Logger.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, providedIn: 'root' });
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, decorators: [{
|
|
60
46
|
type: Injectable,
|
|
61
47
|
args: [{
|
|
62
48
|
providedIn: 'root'
|
|
@@ -70,11 +56,20 @@ class ConsoleAppender {
|
|
|
70
56
|
}
|
|
71
57
|
start() {
|
|
72
58
|
this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {
|
|
59
|
+
let logFunction;
|
|
60
|
+
switch (logEvent.level) {
|
|
61
|
+
case LogLevel.error:
|
|
62
|
+
logFunction = console.error;
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
logFunction = console.log;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
73
68
|
if (logEvent.payload) {
|
|
74
|
-
|
|
69
|
+
logFunction(`[${logEvent.level}] ${logEvent.message}`, logEvent.payload);
|
|
75
70
|
}
|
|
76
71
|
else {
|
|
77
|
-
|
|
72
|
+
logFunction(`[${logEvent.level}] ${logEvent.message}`);
|
|
78
73
|
}
|
|
79
74
|
});
|
|
80
75
|
}
|
|
@@ -82,9 +77,9 @@ class ConsoleAppender {
|
|
|
82
77
|
this.stopEvent$.next(true);
|
|
83
78
|
}
|
|
84
79
|
}
|
|
85
|
-
ConsoleAppender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
86
|
-
ConsoleAppender.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
80
|
+
ConsoleAppender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, deps: [{ token: Logger }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
81
|
+
ConsoleAppender.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, providedIn: 'root' });
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, decorators: [{
|
|
88
83
|
type: Injectable,
|
|
89
84
|
args: [{
|
|
90
85
|
providedIn: 'root'
|
|
@@ -192,9 +187,9 @@ class Store {
|
|
|
192
187
|
}
|
|
193
188
|
}
|
|
194
189
|
}
|
|
195
|
-
Store.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
196
|
-
Store.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
190
|
+
Store.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, deps: [{ token: Logger }, { token: NGSSM_REDUCER, optional: true }, { token: NGSSM_EFFECT, optional: true }, { token: NGSSM_STATE_INITIALIZER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
191
|
+
Store.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, providedIn: 'root' });
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, decorators: [{
|
|
198
193
|
type: Injectable,
|
|
199
194
|
args: [{
|
|
200
195
|
providedIn: 'root'
|
|
@@ -240,9 +235,9 @@ class NgSsmComponent {
|
|
|
240
235
|
this.store.dispatchActionType(actionType);
|
|
241
236
|
}
|
|
242
237
|
}
|
|
243
|
-
NgSsmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
244
|
-
NgSsmComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
238
|
+
NgSsmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: NgSsmComponent, deps: [{ token: Store }], target: i0.ɵɵFactoryTarget.Directive });
|
|
239
|
+
NgSsmComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.6", type: NgSsmComponent, ngImport: i0 });
|
|
240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: NgSsmComponent, decorators: [{
|
|
246
241
|
type: Directive,
|
|
247
242
|
args: [{}]
|
|
248
243
|
}], ctorParameters: function () { return [{ type: Store }]; } });
|
|
@@ -264,5 +259,5 @@ class StoreMock {
|
|
|
264
259
|
* Generated bundle index. Do not edit.
|
|
265
260
|
*/
|
|
266
261
|
|
|
267
|
-
export { ConsoleAppender, LogLevel, Logger, NGSSM_EFFECT, NGSSM_REDUCER, NGSSM_STATE_INITIALIZER, NgSsmComponent, NgSsmFeatureState,
|
|
262
|
+
export { ConsoleAppender, LogLevel, Logger, NGSSM_EFFECT, NGSSM_REDUCER, NGSSM_STATE_INITIALIZER, NgSsmComponent, NgSsmFeatureState, Store, StoreMock };
|
|
268
263
|
//# sourceMappingURL=ngssm-store.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-store.mjs","sources":["../../../projects/ngssm-store/src/lib/ngssm-store.module.ts","../../../projects/ngssm-store/src/lib/reducer.ts","../../../projects/ngssm-store/src/lib/effect.ts","../../../projects/ngssm-store/src/lib/state-initializer.ts","../../../projects/ngssm-store/src/lib/logging/log-level.ts","../../../projects/ngssm-store/src/lib/logging/logger.ts","../../../projects/ngssm-store/src/lib/logging/console-appender.ts","../../../projects/ngssm-store/src/lib/store.ts","../../../projects/ngssm-store/src/lib/ngssm-component.ts","../../../projects/ngssm-store/src/lib/store-mock.ts","../../../projects/ngssm-store/src/public-api.ts","../../../projects/ngssm-store/src/ngssm-store.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\n\n@NgModule({\n declarations: [],\n imports: [],\n exports: []\n})\nexport class NgssmStoreModule {}\n","import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\n\nexport interface Reducer {\n processedActions: string[];\n updateState(state: State, action: Action): State;\n}\n\nexport const NGSSM_REDUCER = new InjectionToken<Reducer>('NGSSM_REDUCER');\n","import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\nexport interface Effect {\n processedActions: string[];\n processAction(store: Store, state: State, action: Action): void;\n}\n\nexport const NGSSM_EFFECT = new InjectionToken<Effect>('NGSSM_EFFECT');\n","import { InjectionToken } from '@angular/core';\nimport { State } from './state';\n\nexport interface StateInitializer {\n initializeState(state: State): State;\n}\n\nexport const NGSSM_STATE_INITIALIZER = new InjectionToken<StateInitializer>('NGSSM_STATE_INITIALIZER');\n","export enum LogLevel {\n debug = 'Debug',\n information = 'Information',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { LogEvent } from './log-event';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Logger {\n private readonly _logEvents$ = new Subject<LogEvent>();\n\n public get logEvents$(): Observable<LogEvent> {\n return this._logEvents$.asObservable();\n }\n\n public debug(message: string, payload?: any): void {\n this.log(LogLevel.debug, message, payload);\n }\n\n public information(message: string, payload?: any): void {\n this.log(LogLevel.information, message, payload);\n }\n\n public error(message: string, payload?: any): void {\n this.log(LogLevel.error, message, payload);\n }\n\n public log(level: LogLevel, message: string, payload?: any): void {\n this._logEvents$.next({\n level,\n message,\n payload\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { Logger } from './logger';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleAppender {\n private readonly stopEvent$ = new Subject<boolean>();\n\n constructor(private logger: Logger) {}\n\n public start(): void {\n this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {\n if (logEvent.payload) {\n console.log(`[${logEvent.level}] ${logEvent.message}`, logEvent.payload);\n } else {\n console.log(`[${logEvent.level}] ${logEvent.message}`);\n }\n });\n }\n\n public stop(): void {\n this.stopEvent$.next(true);\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport update from 'immutability-helper';\n\nimport { FeatureStateSpecification } from './feature-state-specification';\nimport { State } from './state';\nimport { Action } from './action';\nimport { NGSSM_REDUCER, Reducer } from './reducer';\nimport { Effect, NGSSM_EFFECT } from './effect';\nimport { NGSSM_STATE_INITIALIZER, StateInitializer } from './state-initializer';\nimport { Logger } from './logging';\n\nconst featureStateSpecifications: FeatureStateSpecification[] = [];\nexport const NgSsmFeatureState = (specification: FeatureStateSpecification) => {\n return (target: object) => {\n featureStateSpecifications.push(specification);\n };\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Store {\n private readonly _state$ = new BehaviorSubject<State>({});\n private readonly actionQueue: Action[] = [];\n private readonly reducersPerActionType = new Map<string, Reducer[]>();\n private readonly effectsPerActionType = new Map<string, Effect[]>();\n\n constructor(\n private logger: Logger,\n @Inject(NGSSM_REDUCER) @Optional() reducers: Reducer[],\n @Inject(NGSSM_EFFECT) @Optional() effects: Effect[],\n @Inject(NGSSM_STATE_INITIALIZER) @Optional() initializers: StateInitializer[]\n ) {\n this.logger.information('[Store] ---> state initialization...');\n let state = this._state$.getValue();\n state = featureStateSpecifications.reduce((p, c) => update(p, { [c.featureStateKey]: { $set: c.initialState } }), state);\n\n (initializers ?? []).forEach((initializer) => {\n this.logger.information('[Store] ------> calling initializer', initializer);\n state = initializer.initializeState(state);\n });\n\n this._state$.next(state);\n\n this.logger.information(`[Store] ---> initialization of ${(reducers ?? []).length} reducers...`);\n (reducers ?? []).forEach((reducer) => {\n this.logger.information('[Store] ------> initialization of ', reducer);\n reducer.processedActions.forEach((processedAction) => {\n const storeReducers: Reducer[] = this.reducersPerActionType.get(processedAction) ?? [];\n if (storeReducers.length === 0) {\n this.reducersPerActionType.set(processedAction, storeReducers);\n }\n\n storeReducers.push(reducer);\n });\n });\n\n this.logger.information(`[Store] ---> initialization of ${(effects ?? []).length} effects...`);\n (effects ?? []).forEach((effect) => {\n this.logger.information('[Store] ------> initialization of ', effect);\n effect.processedActions.forEach((processedAction) => {\n const storedEffects: Effect[] = this.effectsPerActionType.get(processedAction) ?? [];\n if (storedEffects.length === 0) {\n this.effectsPerActionType.set(processedAction, storedEffects);\n }\n\n storedEffects.push(effect);\n });\n });\n }\n\n public get state$(): Observable<State> {\n return this._state$.asObservable();\n }\n\n public dispatchAction(action: Action): void {\n this.actionQueue.push(action);\n this.logger.debug(`Action of type '${action.type}' added to the queue => ${this.actionQueue.length} pending actions`, action);\n setTimeout(() => this.processNextAction());\n }\n\n public dispatchActionType(type: string): void {\n this.dispatchAction({ type });\n }\n\n private processNextAction(): void {\n const nextAction = this.actionQueue.shift();\n if (!nextAction) {\n this.logger.debug('[processNextAction] No action to process');\n return;\n }\n\n this.logger.information(`[processNextAction] Start processing action '${nextAction.type}...`, nextAction);\n\n try {\n const reducers = this.reducersPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${reducers.length} reducers found to process the action ${nextAction.type}`, reducers);\n const currentState = this._state$.getValue();\n const updatedState = reducers.reduce((p, c) => c.updateState(p, nextAction), currentState);\n\n if (updatedState !== currentState) {\n this._state$.next(updatedState);\n }\n\n const effects = this.effectsPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${effects.length} effects found to process the action ${nextAction.type}`, effects);\n effects.forEach((effect) => {\n try {\n effect.processAction(this, updatedState, nextAction);\n } catch (error) {\n this.logger.error(`Unable to process action ${nextAction.type} by effect ${effect}`, {\n error,\n action: nextAction,\n processor: effect\n });\n }\n });\n } catch (error) {\n this.logger.error(`Error when processing action ${nextAction.type}`, {\n error,\n action: nextAction\n });\n } finally {\n this.logger.information(`[processNextAction] action '${nextAction.type} processed.`, nextAction);\n\n // Should not be useful.But, just in case.\n setTimeout(() => this.processNextAction());\n }\n }\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { map, Observable, Subject, distinctUntilChanged, takeUntil } from 'rxjs';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\n@Directive({})\nexport class NgSsmComponent implements OnDestroy {\n private readonly _unsubscribeAll$ = new Subject<void>();\n\n constructor(protected store: Store) {}\n\n protected get unsubscribeAll$(): Observable<void> {\n return this._unsubscribeAll$.asObservable();\n }\n\n public ngOnDestroy(): void {\n this._unsubscribeAll$.next();\n this._unsubscribeAll$.complete();\n }\n\n public watch<T>(selector: (state: State) => T): Observable<T> {\n return this.store.state$.pipe(\n map((state) => selector(state)),\n distinctUntilChanged(),\n takeUntil(this.unsubscribeAll$)\n );\n }\n\n public dispatchAction(action: Action): void {\n this.store.dispatchAction(action);\n }\n\n public dispatchActionType(actionType: string): void {\n this.store.dispatchActionType(actionType);\n }\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Action } from './action';\n\nexport class StoreMock {\n public state$ = new BehaviorSubject<{ [key: string]: any }>({});\n\n constructor(initialState: { [key: string]: any }) {\n this.state$.next(initialState);\n }\n\n public dispatchAction(action: Action): void {}\n\n public dispatchActionType(type: string): void {}\n}\n","/*\n * Public API Surface of ngssm-store\n */\n\nexport * from './lib/ngssm-store.module';\n\nexport * from './lib/store';\nexport * from './lib/state';\nexport * from './lib/action';\nexport * from './lib/reducer';\nexport * from './lib/effect';\nexport * from './lib/feature-state-specification';\nexport * from './lib/ngssm-component';\nexport * from './lib/state-initializer';\nexport * from './lib/logging';\nexport * from './lib/store-mock';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.Logger","i1.Store"],"mappings":";;;;;MAOa,gBAAgB,CAAA;;6GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;8GAAhB,gBAAgB,EAAA,CAAA,CAAA;8GAAhB,gBAAgB,EAAA,CAAA,CAAA;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;iBACZ,CAAA;;;MCIY,aAAa,GAAG,IAAI,cAAc,CAAU,e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/ngssm-store/src/lib/reducer.ts","../../../projects/ngssm-store/src/lib/effect.ts","../../../projects/ngssm-store/src/lib/state-initializer.ts","../../../projects/ngssm-store/src/lib/logging/log-level.ts","../../../projects/ngssm-store/src/lib/logging/logger.ts","../../../projects/ngssm-store/src/lib/logging/console-appender.ts","../../../projects/ngssm-store/src/lib/store.ts","../../../projects/ngssm-store/src/lib/ngssm-component.ts","../../../projects/ngssm-store/src/lib/store-mock.ts","../../../projects/ngssm-store/src/public-api.ts","../../../projects/ngssm-store/src/ngssm-store.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\n\nexport interface Reducer {\n processedActions: string[];\n updateState(state: State, action: Action): State;\n}\n\nexport const NGSSM_REDUCER = new InjectionToken<Reducer>('NGSSM_REDUCER');\n","import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\nexport interface Effect {\n processedActions: string[];\n processAction(store: Store, state: State, action: Action): void;\n}\n\nexport const NGSSM_EFFECT = new InjectionToken<Effect>('NGSSM_EFFECT');\n","import { InjectionToken } from '@angular/core';\nimport { State } from './state';\n\nexport interface StateInitializer {\n initializeState(state: State): State;\n}\n\nexport const NGSSM_STATE_INITIALIZER = new InjectionToken<StateInitializer>('NGSSM_STATE_INITIALIZER');\n","export enum LogLevel {\n debug = 'Debug',\n information = 'Information',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { LogEvent } from './log-event';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Logger {\n private readonly _logEvents$ = new Subject<LogEvent>();\n\n public get logEvents$(): Observable<LogEvent> {\n return this._logEvents$.asObservable();\n }\n\n public debug(message: string, payload?: any): void {\n this.log(LogLevel.debug, message, payload);\n }\n\n public information(message: string, payload?: any): void {\n this.log(LogLevel.information, message, payload);\n }\n\n public error(message: string, payload?: any): void {\n this.log(LogLevel.error, message, payload);\n }\n\n public log(level: LogLevel, message: string, payload?: any): void {\n this._logEvents$.next({\n level,\n message,\n payload\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { Logger } from './logger';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleAppender {\n private readonly stopEvent$ = new Subject<boolean>();\n\n constructor(private logger: Logger) {}\n\n public start(): void {\n this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {\n let logFunction: any;\n switch (logEvent.level) {\n case LogLevel.error:\n logFunction = console.error;\n break;\n\n default:\n logFunction = console.log;\n break;\n }\n\n if (logEvent.payload) {\n logFunction(`[${logEvent.level}] ${logEvent.message}`, logEvent.payload);\n } else {\n logFunction(`[${logEvent.level}] ${logEvent.message}`);\n }\n });\n }\n\n public stop(): void {\n this.stopEvent$.next(true);\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport update from 'immutability-helper';\n\nimport { FeatureStateSpecification } from './feature-state-specification';\nimport { State } from './state';\nimport { Action } from './action';\nimport { NGSSM_REDUCER, Reducer } from './reducer';\nimport { Effect, NGSSM_EFFECT } from './effect';\nimport { NGSSM_STATE_INITIALIZER, StateInitializer } from './state-initializer';\nimport { Logger } from './logging';\n\nconst featureStateSpecifications: FeatureStateSpecification[] = [];\nexport const NgSsmFeatureState = (specification: FeatureStateSpecification) => {\n return (target: object) => {\n featureStateSpecifications.push(specification);\n };\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Store {\n private readonly _state$ = new BehaviorSubject<State>({});\n private readonly actionQueue: Action[] = [];\n private readonly reducersPerActionType = new Map<string, Reducer[]>();\n private readonly effectsPerActionType = new Map<string, Effect[]>();\n\n constructor(\n private logger: Logger,\n @Inject(NGSSM_REDUCER) @Optional() reducers: Reducer[],\n @Inject(NGSSM_EFFECT) @Optional() effects: Effect[],\n @Inject(NGSSM_STATE_INITIALIZER) @Optional() initializers: StateInitializer[]\n ) {\n this.logger.information('[Store] ---> state initialization...');\n let state = this._state$.getValue();\n state = featureStateSpecifications.reduce((p, c) => update(p, { [c.featureStateKey]: { $set: c.initialState } }), state);\n\n (initializers ?? []).forEach((initializer) => {\n this.logger.information('[Store] ------> calling initializer', initializer);\n state = initializer.initializeState(state);\n });\n\n this._state$.next(state);\n\n this.logger.information(`[Store] ---> initialization of ${(reducers ?? []).length} reducers...`);\n (reducers ?? []).forEach((reducer) => {\n this.logger.information('[Store] ------> initialization of ', reducer);\n reducer.processedActions.forEach((processedAction) => {\n const storeReducers: Reducer[] = this.reducersPerActionType.get(processedAction) ?? [];\n if (storeReducers.length === 0) {\n this.reducersPerActionType.set(processedAction, storeReducers);\n }\n\n storeReducers.push(reducer);\n });\n });\n\n this.logger.information(`[Store] ---> initialization of ${(effects ?? []).length} effects...`);\n (effects ?? []).forEach((effect) => {\n this.logger.information('[Store] ------> initialization of ', effect);\n effect.processedActions.forEach((processedAction) => {\n const storedEffects: Effect[] = this.effectsPerActionType.get(processedAction) ?? [];\n if (storedEffects.length === 0) {\n this.effectsPerActionType.set(processedAction, storedEffects);\n }\n\n storedEffects.push(effect);\n });\n });\n }\n\n public get state$(): Observable<State> {\n return this._state$.asObservable();\n }\n\n public dispatchAction(action: Action): void {\n this.actionQueue.push(action);\n this.logger.debug(`Action of type '${action.type}' added to the queue => ${this.actionQueue.length} pending actions`, action);\n setTimeout(() => this.processNextAction());\n }\n\n public dispatchActionType(type: string): void {\n this.dispatchAction({ type });\n }\n\n private processNextAction(): void {\n const nextAction = this.actionQueue.shift();\n if (!nextAction) {\n this.logger.debug('[processNextAction] No action to process');\n return;\n }\n\n this.logger.information(`[processNextAction] Start processing action '${nextAction.type}...`, nextAction);\n\n try {\n const reducers = this.reducersPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${reducers.length} reducers found to process the action ${nextAction.type}`, reducers);\n const currentState = this._state$.getValue();\n const updatedState = reducers.reduce((p, c) => c.updateState(p, nextAction), currentState);\n\n if (updatedState !== currentState) {\n this._state$.next(updatedState);\n }\n\n const effects = this.effectsPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${effects.length} effects found to process the action ${nextAction.type}`, effects);\n effects.forEach((effect) => {\n try {\n effect.processAction(this, updatedState, nextAction);\n } catch (error) {\n this.logger.error(`Unable to process action ${nextAction.type} by effect ${effect}`, {\n error,\n action: nextAction,\n processor: effect\n });\n }\n });\n } catch (error) {\n this.logger.error(`Error when processing action ${nextAction.type}`, {\n error,\n action: nextAction\n });\n } finally {\n this.logger.information(`[processNextAction] action '${nextAction.type} processed.`, nextAction);\n\n // Should not be useful.But, just in case.\n setTimeout(() => this.processNextAction());\n }\n }\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { map, Observable, Subject, distinctUntilChanged, takeUntil } from 'rxjs';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\n@Directive({})\nexport class NgSsmComponent implements OnDestroy {\n private readonly _unsubscribeAll$ = new Subject<void>();\n\n constructor(protected store: Store) {}\n\n protected get unsubscribeAll$(): Observable<void> {\n return this._unsubscribeAll$.asObservable();\n }\n\n public ngOnDestroy(): void {\n this._unsubscribeAll$.next();\n this._unsubscribeAll$.complete();\n }\n\n public watch<T>(selector: (state: State) => T): Observable<T> {\n return this.store.state$.pipe(\n map((state) => selector(state)),\n distinctUntilChanged(),\n takeUntil(this.unsubscribeAll$)\n );\n }\n\n public dispatchAction(action: Action): void {\n this.store.dispatchAction(action);\n }\n\n public dispatchActionType(actionType: string): void {\n this.store.dispatchActionType(actionType);\n }\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Action } from './action';\n\nexport class StoreMock {\n public state$ = new BehaviorSubject<{ [key: string]: any }>({});\n\n constructor(initialState: { [key: string]: any }) {\n this.state$.next(initialState);\n }\n\n public dispatchAction(action: Action): void {}\n\n public dispatchActionType(type: string): void {}\n}\n","/*\n * Public API Surface of ngssm-store\n */\n\nexport * from './lib/store';\nexport * from './lib/state';\nexport * from './lib/action';\nexport * from './lib/reducer';\nexport * from './lib/effect';\nexport * from './lib/feature-state-specification';\nexport * from './lib/ngssm-component';\nexport * from './lib/state-initializer';\nexport * from './lib/logging';\nexport * from './lib/store-mock';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.Logger","i1.Store"],"mappings":";;;;;MAUa,aAAa,GAAG,IAAI,cAAc,CAAU,eAAe;;MCC3D,YAAY,GAAG,IAAI,cAAc,CAAS,cAAc;;MCJxD,uBAAuB,GAAG,IAAI,cAAc,CAAmB,yBAAyB;;ACPzF,IAAA,SAIX;AAJD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,QAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EAJW,QAAQ,KAAR,QAAQ,GAInB,EAAA,CAAA,CAAA;;MCKY,MAAM,CAAA;AAHnB,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,OAAO,EAAY,CAAC;KAyBxD;AAvBC,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;KACxC;IAEM,KAAK,CAAC,OAAe,EAAE,OAAa,EAAA;QACzC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAC5C;IAEM,WAAW,CAAC,OAAe,EAAE,OAAa,EAAA;QAC/C,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAClD;IAEM,KAAK,CAAC,OAAe,EAAE,OAAa,EAAA;QACzC,IAAI,CAAC,GAAG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SAAA,EAAA,CAAA,CAAA;+FAAd,cAAc,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,SAAS;mBAAC,EAAE,CAAA;;;MCJA,SAAS,CAAA;AAGpB,IAAA,WAAA,CAAY,YAAoC,EAAA;QAFzC,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAAyB,EAAE,CAAC,CAAC;AAG9D,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAChC;IAEM,cAAc,CAAC,MAAc,EAAA,GAAU;IAEvC,kBAAkB,CAAC,IAAY,EAAA,GAAU;AACjD;;ACbD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/fesm2020/ngssm-store.mjs
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { InjectionToken, Injectable, Inject, Optional, Directive } from '@angular/core';
|
|
3
3
|
import { Subject, takeUntil, BehaviorSubject, map, distinctUntilChanged } from 'rxjs';
|
|
4
4
|
import update from 'immutability-helper';
|
|
5
5
|
|
|
6
|
-
class NgssmStoreModule {
|
|
7
|
-
}
|
|
8
|
-
NgssmStoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
-
NgssmStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule });
|
|
10
|
-
NgssmStoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule });
|
|
11
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule, decorators: [{
|
|
12
|
-
type: NgModule,
|
|
13
|
-
args: [{
|
|
14
|
-
declarations: [],
|
|
15
|
-
imports: [],
|
|
16
|
-
exports: []
|
|
17
|
-
}]
|
|
18
|
-
}] });
|
|
19
|
-
|
|
20
6
|
const NGSSM_REDUCER = new InjectionToken('NGSSM_REDUCER');
|
|
21
7
|
|
|
22
8
|
const NGSSM_EFFECT = new InjectionToken('NGSSM_EFFECT');
|
|
@@ -54,9 +40,9 @@ class Logger {
|
|
|
54
40
|
});
|
|
55
41
|
}
|
|
56
42
|
}
|
|
57
|
-
Logger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
58
|
-
Logger.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
43
|
+
Logger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
+
Logger.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, providedIn: 'root' });
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Logger, decorators: [{
|
|
60
46
|
type: Injectable,
|
|
61
47
|
args: [{
|
|
62
48
|
providedIn: 'root'
|
|
@@ -70,11 +56,20 @@ class ConsoleAppender {
|
|
|
70
56
|
}
|
|
71
57
|
start() {
|
|
72
58
|
this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {
|
|
59
|
+
let logFunction;
|
|
60
|
+
switch (logEvent.level) {
|
|
61
|
+
case LogLevel.error:
|
|
62
|
+
logFunction = console.error;
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
logFunction = console.log;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
73
68
|
if (logEvent.payload) {
|
|
74
|
-
|
|
69
|
+
logFunction(`[${logEvent.level}] ${logEvent.message}`, logEvent.payload);
|
|
75
70
|
}
|
|
76
71
|
else {
|
|
77
|
-
|
|
72
|
+
logFunction(`[${logEvent.level}] ${logEvent.message}`);
|
|
78
73
|
}
|
|
79
74
|
});
|
|
80
75
|
}
|
|
@@ -82,9 +77,9 @@ class ConsoleAppender {
|
|
|
82
77
|
this.stopEvent$.next(true);
|
|
83
78
|
}
|
|
84
79
|
}
|
|
85
|
-
ConsoleAppender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
86
|
-
ConsoleAppender.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
80
|
+
ConsoleAppender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, deps: [{ token: Logger }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
81
|
+
ConsoleAppender.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, providedIn: 'root' });
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: ConsoleAppender, decorators: [{
|
|
88
83
|
type: Injectable,
|
|
89
84
|
args: [{
|
|
90
85
|
providedIn: 'root'
|
|
@@ -189,9 +184,9 @@ class Store {
|
|
|
189
184
|
}
|
|
190
185
|
}
|
|
191
186
|
}
|
|
192
|
-
Store.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
193
|
-
Store.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
187
|
+
Store.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, deps: [{ token: Logger }, { token: NGSSM_REDUCER, optional: true }, { token: NGSSM_EFFECT, optional: true }, { token: NGSSM_STATE_INITIALIZER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
188
|
+
Store.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, providedIn: 'root' });
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: Store, decorators: [{
|
|
195
190
|
type: Injectable,
|
|
196
191
|
args: [{
|
|
197
192
|
providedIn: 'root'
|
|
@@ -235,9 +230,9 @@ class NgSsmComponent {
|
|
|
235
230
|
this.store.dispatchActionType(actionType);
|
|
236
231
|
}
|
|
237
232
|
}
|
|
238
|
-
NgSsmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
239
|
-
NgSsmComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
233
|
+
NgSsmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: NgSsmComponent, deps: [{ token: Store }], target: i0.ɵɵFactoryTarget.Directive });
|
|
234
|
+
NgSsmComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.6", type: NgSsmComponent, ngImport: i0 });
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: NgSsmComponent, decorators: [{
|
|
241
236
|
type: Directive,
|
|
242
237
|
args: [{}]
|
|
243
238
|
}], ctorParameters: function () { return [{ type: Store }]; } });
|
|
@@ -259,5 +254,5 @@ class StoreMock {
|
|
|
259
254
|
* Generated bundle index. Do not edit.
|
|
260
255
|
*/
|
|
261
256
|
|
|
262
|
-
export { ConsoleAppender, LogLevel, Logger, NGSSM_EFFECT, NGSSM_REDUCER, NGSSM_STATE_INITIALIZER, NgSsmComponent, NgSsmFeatureState,
|
|
257
|
+
export { ConsoleAppender, LogLevel, Logger, NGSSM_EFFECT, NGSSM_REDUCER, NGSSM_STATE_INITIALIZER, NgSsmComponent, NgSsmFeatureState, Store, StoreMock };
|
|
263
258
|
//# sourceMappingURL=ngssm-store.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-store.mjs","sources":["../../../projects/ngssm-store/src/lib/ngssm-store.module.ts","../../../projects/ngssm-store/src/lib/reducer.ts","../../../projects/ngssm-store/src/lib/effect.ts","../../../projects/ngssm-store/src/lib/state-initializer.ts","../../../projects/ngssm-store/src/lib/logging/log-level.ts","../../../projects/ngssm-store/src/lib/logging/logger.ts","../../../projects/ngssm-store/src/lib/logging/console-appender.ts","../../../projects/ngssm-store/src/lib/store.ts","../../../projects/ngssm-store/src/lib/ngssm-component.ts","../../../projects/ngssm-store/src/lib/store-mock.ts","../../../projects/ngssm-store/src/public-api.ts","../../../projects/ngssm-store/src/ngssm-store.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\n\n@NgModule({\n declarations: [],\n imports: [],\n exports: []\n})\nexport class NgssmStoreModule {}\n","import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\n\nexport interface Reducer {\n processedActions: string[];\n updateState(state: State, action: Action): State;\n}\n\nexport const NGSSM_REDUCER = new InjectionToken<Reducer>('NGSSM_REDUCER');\n","import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\nexport interface Effect {\n processedActions: string[];\n processAction(store: Store, state: State, action: Action): void;\n}\n\nexport const NGSSM_EFFECT = new InjectionToken<Effect>('NGSSM_EFFECT');\n","import { InjectionToken } from '@angular/core';\nimport { State } from './state';\n\nexport interface StateInitializer {\n initializeState(state: State): State;\n}\n\nexport const NGSSM_STATE_INITIALIZER = new InjectionToken<StateInitializer>('NGSSM_STATE_INITIALIZER');\n","export enum LogLevel {\n debug = 'Debug',\n information = 'Information',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { LogEvent } from './log-event';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Logger {\n private readonly _logEvents$ = new Subject<LogEvent>();\n\n public get logEvents$(): Observable<LogEvent> {\n return this._logEvents$.asObservable();\n }\n\n public debug(message: string, payload?: any): void {\n this.log(LogLevel.debug, message, payload);\n }\n\n public information(message: string, payload?: any): void {\n this.log(LogLevel.information, message, payload);\n }\n\n public error(message: string, payload?: any): void {\n this.log(LogLevel.error, message, payload);\n }\n\n public log(level: LogLevel, message: string, payload?: any): void {\n this._logEvents$.next({\n level,\n message,\n payload\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { Logger } from './logger';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleAppender {\n private readonly stopEvent$ = new Subject<boolean>();\n\n constructor(private logger: Logger) {}\n\n public start(): void {\n this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {\n if (logEvent.payload) {\n console.log(`[${logEvent.level}] ${logEvent.message}`, logEvent.payload);\n } else {\n console.log(`[${logEvent.level}] ${logEvent.message}`);\n }\n });\n }\n\n public stop(): void {\n this.stopEvent$.next(true);\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport update from 'immutability-helper';\n\nimport { FeatureStateSpecification } from './feature-state-specification';\nimport { State } from './state';\nimport { Action } from './action';\nimport { NGSSM_REDUCER, Reducer } from './reducer';\nimport { Effect, NGSSM_EFFECT } from './effect';\nimport { NGSSM_STATE_INITIALIZER, StateInitializer } from './state-initializer';\nimport { Logger } from './logging';\n\nconst featureStateSpecifications: FeatureStateSpecification[] = [];\nexport const NgSsmFeatureState = (specification: FeatureStateSpecification) => {\n return (target: object) => {\n featureStateSpecifications.push(specification);\n };\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Store {\n private readonly _state$ = new BehaviorSubject<State>({});\n private readonly actionQueue: Action[] = [];\n private readonly reducersPerActionType = new Map<string, Reducer[]>();\n private readonly effectsPerActionType = new Map<string, Effect[]>();\n\n constructor(\n private logger: Logger,\n @Inject(NGSSM_REDUCER) @Optional() reducers: Reducer[],\n @Inject(NGSSM_EFFECT) @Optional() effects: Effect[],\n @Inject(NGSSM_STATE_INITIALIZER) @Optional() initializers: StateInitializer[]\n ) {\n this.logger.information('[Store] ---> state initialization...');\n let state = this._state$.getValue();\n state = featureStateSpecifications.reduce((p, c) => update(p, { [c.featureStateKey]: { $set: c.initialState } }), state);\n\n (initializers ?? []).forEach((initializer) => {\n this.logger.information('[Store] ------> calling initializer', initializer);\n state = initializer.initializeState(state);\n });\n\n this._state$.next(state);\n\n this.logger.information(`[Store] ---> initialization of ${(reducers ?? []).length} reducers...`);\n (reducers ?? []).forEach((reducer) => {\n this.logger.information('[Store] ------> initialization of ', reducer);\n reducer.processedActions.forEach((processedAction) => {\n const storeReducers: Reducer[] = this.reducersPerActionType.get(processedAction) ?? [];\n if (storeReducers.length === 0) {\n this.reducersPerActionType.set(processedAction, storeReducers);\n }\n\n storeReducers.push(reducer);\n });\n });\n\n this.logger.information(`[Store] ---> initialization of ${(effects ?? []).length} effects...`);\n (effects ?? []).forEach((effect) => {\n this.logger.information('[Store] ------> initialization of ', effect);\n effect.processedActions.forEach((processedAction) => {\n const storedEffects: Effect[] = this.effectsPerActionType.get(processedAction) ?? [];\n if (storedEffects.length === 0) {\n this.effectsPerActionType.set(processedAction, storedEffects);\n }\n\n storedEffects.push(effect);\n });\n });\n }\n\n public get state$(): Observable<State> {\n return this._state$.asObservable();\n }\n\n public dispatchAction(action: Action): void {\n this.actionQueue.push(action);\n this.logger.debug(`Action of type '${action.type}' added to the queue => ${this.actionQueue.length} pending actions`, action);\n setTimeout(() => this.processNextAction());\n }\n\n public dispatchActionType(type: string): void {\n this.dispatchAction({ type });\n }\n\n private processNextAction(): void {\n const nextAction = this.actionQueue.shift();\n if (!nextAction) {\n this.logger.debug('[processNextAction] No action to process');\n return;\n }\n\n this.logger.information(`[processNextAction] Start processing action '${nextAction.type}...`, nextAction);\n\n try {\n const reducers = this.reducersPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${reducers.length} reducers found to process the action ${nextAction.type}`, reducers);\n const currentState = this._state$.getValue();\n const updatedState = reducers.reduce((p, c) => c.updateState(p, nextAction), currentState);\n\n if (updatedState !== currentState) {\n this._state$.next(updatedState);\n }\n\n const effects = this.effectsPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${effects.length} effects found to process the action ${nextAction.type}`, effects);\n effects.forEach((effect) => {\n try {\n effect.processAction(this, updatedState, nextAction);\n } catch (error) {\n this.logger.error(`Unable to process action ${nextAction.type} by effect ${effect}`, {\n error,\n action: nextAction,\n processor: effect\n });\n }\n });\n } catch (error) {\n this.logger.error(`Error when processing action ${nextAction.type}`, {\n error,\n action: nextAction\n });\n } finally {\n this.logger.information(`[processNextAction] action '${nextAction.type} processed.`, nextAction);\n\n // Should not be useful.But, just in case.\n setTimeout(() => this.processNextAction());\n }\n }\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { map, Observable, Subject, distinctUntilChanged, takeUntil } from 'rxjs';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\n@Directive({})\nexport class NgSsmComponent implements OnDestroy {\n private readonly _unsubscribeAll$ = new Subject<void>();\n\n constructor(protected store: Store) {}\n\n protected get unsubscribeAll$(): Observable<void> {\n return this._unsubscribeAll$.asObservable();\n }\n\n public ngOnDestroy(): void {\n this._unsubscribeAll$.next();\n this._unsubscribeAll$.complete();\n }\n\n public watch<T>(selector: (state: State) => T): Observable<T> {\n return this.store.state$.pipe(\n map((state) => selector(state)),\n distinctUntilChanged(),\n takeUntil(this.unsubscribeAll$)\n );\n }\n\n public dispatchAction(action: Action): void {\n this.store.dispatchAction(action);\n }\n\n public dispatchActionType(actionType: string): void {\n this.store.dispatchActionType(actionType);\n }\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Action } from './action';\n\nexport class StoreMock {\n public state$ = new BehaviorSubject<{ [key: string]: any }>({});\n\n constructor(initialState: { [key: string]: any }) {\n this.state$.next(initialState);\n }\n\n public dispatchAction(action: Action): void {}\n\n public dispatchActionType(type: string): void {}\n}\n","/*\n * Public API Surface of ngssm-store\n */\n\nexport * from './lib/ngssm-store.module';\n\nexport * from './lib/store';\nexport * from './lib/state';\nexport * from './lib/action';\nexport * from './lib/reducer';\nexport * from './lib/effect';\nexport * from './lib/feature-state-specification';\nexport * from './lib/ngssm-component';\nexport * from './lib/state-initializer';\nexport * from './lib/logging';\nexport * from './lib/store-mock';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.Logger","i1.Store"],"mappings":";;;;;MAOa,gBAAgB,CAAA;;6GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;8GAAhB,gBAAgB,EAAA,CAAA,CAAA;8GAAhB,gBAAgB,EAAA,CAAA,CAAA;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;AACZ,iBAAA,CAAA;;;MCIY,aAAa,GAAG,IAAI,cAAc,CAAU,eAAe;;MCC3D,YAAY,GAAG,IAAI,cAAc,CAAS,cAAc;;MCJxD,uBAAuB,GAAG,IAAI,cAAc,CAAmB,yBAAyB;;ICPzF,SA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,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;+FAAd,cAAc,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,SAAS;mBAAC,EAAE,CAAA;;;MCJA,SAAS,CAAA;AAGpB,IAAA,WAAA,CAAY,YAAoC,EAAA;AAFzC,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAAyB,EAAE,CAAC,CAAC;AAG9D,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAChC;IAEM,cAAc,CAAC,MAAc,EAAA,GAAU;IAEvC,kBAAkB,CAAC,IAAY,EAAA,GAAU;AACjD;;ACbD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngssm-store.mjs","sources":["../../../projects/ngssm-store/src/lib/reducer.ts","../../../projects/ngssm-store/src/lib/effect.ts","../../../projects/ngssm-store/src/lib/state-initializer.ts","../../../projects/ngssm-store/src/lib/logging/log-level.ts","../../../projects/ngssm-store/src/lib/logging/logger.ts","../../../projects/ngssm-store/src/lib/logging/console-appender.ts","../../../projects/ngssm-store/src/lib/store.ts","../../../projects/ngssm-store/src/lib/ngssm-component.ts","../../../projects/ngssm-store/src/lib/store-mock.ts","../../../projects/ngssm-store/src/public-api.ts","../../../projects/ngssm-store/src/ngssm-store.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\n\nexport interface Reducer {\n processedActions: string[];\n updateState(state: State, action: Action): State;\n}\n\nexport const NGSSM_REDUCER = new InjectionToken<Reducer>('NGSSM_REDUCER');\n","import { InjectionToken } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\nexport interface Effect {\n processedActions: string[];\n processAction(store: Store, state: State, action: Action): void;\n}\n\nexport const NGSSM_EFFECT = new InjectionToken<Effect>('NGSSM_EFFECT');\n","import { InjectionToken } from '@angular/core';\nimport { State } from './state';\n\nexport interface StateInitializer {\n initializeState(state: State): State;\n}\n\nexport const NGSSM_STATE_INITIALIZER = new InjectionToken<StateInitializer>('NGSSM_STATE_INITIALIZER');\n","export enum LogLevel {\n debug = 'Debug',\n information = 'Information',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { LogEvent } from './log-event';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Logger {\n private readonly _logEvents$ = new Subject<LogEvent>();\n\n public get logEvents$(): Observable<LogEvent> {\n return this._logEvents$.asObservable();\n }\n\n public debug(message: string, payload?: any): void {\n this.log(LogLevel.debug, message, payload);\n }\n\n public information(message: string, payload?: any): void {\n this.log(LogLevel.information, message, payload);\n }\n\n public error(message: string, payload?: any): void {\n this.log(LogLevel.error, message, payload);\n }\n\n public log(level: LogLevel, message: string, payload?: any): void {\n this._logEvents$.next({\n level,\n message,\n payload\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { Logger } from './logger';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleAppender {\n private readonly stopEvent$ = new Subject<boolean>();\n\n constructor(private logger: Logger) {}\n\n public start(): void {\n this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {\n let logFunction: any;\n switch (logEvent.level) {\n case LogLevel.error:\n logFunction = console.error;\n break;\n\n default:\n logFunction = console.log;\n break;\n }\n\n if (logEvent.payload) {\n logFunction(`[${logEvent.level}] ${logEvent.message}`, logEvent.payload);\n } else {\n logFunction(`[${logEvent.level}] ${logEvent.message}`);\n }\n });\n }\n\n public stop(): void {\n this.stopEvent$.next(true);\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport update from 'immutability-helper';\n\nimport { FeatureStateSpecification } from './feature-state-specification';\nimport { State } from './state';\nimport { Action } from './action';\nimport { NGSSM_REDUCER, Reducer } from './reducer';\nimport { Effect, NGSSM_EFFECT } from './effect';\nimport { NGSSM_STATE_INITIALIZER, StateInitializer } from './state-initializer';\nimport { Logger } from './logging';\n\nconst featureStateSpecifications: FeatureStateSpecification[] = [];\nexport const NgSsmFeatureState = (specification: FeatureStateSpecification) => {\n return (target: object) => {\n featureStateSpecifications.push(specification);\n };\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Store {\n private readonly _state$ = new BehaviorSubject<State>({});\n private readonly actionQueue: Action[] = [];\n private readonly reducersPerActionType = new Map<string, Reducer[]>();\n private readonly effectsPerActionType = new Map<string, Effect[]>();\n\n constructor(\n private logger: Logger,\n @Inject(NGSSM_REDUCER) @Optional() reducers: Reducer[],\n @Inject(NGSSM_EFFECT) @Optional() effects: Effect[],\n @Inject(NGSSM_STATE_INITIALIZER) @Optional() initializers: StateInitializer[]\n ) {\n this.logger.information('[Store] ---> state initialization...');\n let state = this._state$.getValue();\n state = featureStateSpecifications.reduce((p, c) => update(p, { [c.featureStateKey]: { $set: c.initialState } }), state);\n\n (initializers ?? []).forEach((initializer) => {\n this.logger.information('[Store] ------> calling initializer', initializer);\n state = initializer.initializeState(state);\n });\n\n this._state$.next(state);\n\n this.logger.information(`[Store] ---> initialization of ${(reducers ?? []).length} reducers...`);\n (reducers ?? []).forEach((reducer) => {\n this.logger.information('[Store] ------> initialization of ', reducer);\n reducer.processedActions.forEach((processedAction) => {\n const storeReducers: Reducer[] = this.reducersPerActionType.get(processedAction) ?? [];\n if (storeReducers.length === 0) {\n this.reducersPerActionType.set(processedAction, storeReducers);\n }\n\n storeReducers.push(reducer);\n });\n });\n\n this.logger.information(`[Store] ---> initialization of ${(effects ?? []).length} effects...`);\n (effects ?? []).forEach((effect) => {\n this.logger.information('[Store] ------> initialization of ', effect);\n effect.processedActions.forEach((processedAction) => {\n const storedEffects: Effect[] = this.effectsPerActionType.get(processedAction) ?? [];\n if (storedEffects.length === 0) {\n this.effectsPerActionType.set(processedAction, storedEffects);\n }\n\n storedEffects.push(effect);\n });\n });\n }\n\n public get state$(): Observable<State> {\n return this._state$.asObservable();\n }\n\n public dispatchAction(action: Action): void {\n this.actionQueue.push(action);\n this.logger.debug(`Action of type '${action.type}' added to the queue => ${this.actionQueue.length} pending actions`, action);\n setTimeout(() => this.processNextAction());\n }\n\n public dispatchActionType(type: string): void {\n this.dispatchAction({ type });\n }\n\n private processNextAction(): void {\n const nextAction = this.actionQueue.shift();\n if (!nextAction) {\n this.logger.debug('[processNextAction] No action to process');\n return;\n }\n\n this.logger.information(`[processNextAction] Start processing action '${nextAction.type}...`, nextAction);\n\n try {\n const reducers = this.reducersPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${reducers.length} reducers found to process the action ${nextAction.type}`, reducers);\n const currentState = this._state$.getValue();\n const updatedState = reducers.reduce((p, c) => c.updateState(p, nextAction), currentState);\n\n if (updatedState !== currentState) {\n this._state$.next(updatedState);\n }\n\n const effects = this.effectsPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${effects.length} effects found to process the action ${nextAction.type}`, effects);\n effects.forEach((effect) => {\n try {\n effect.processAction(this, updatedState, nextAction);\n } catch (error) {\n this.logger.error(`Unable to process action ${nextAction.type} by effect ${effect}`, {\n error,\n action: nextAction,\n processor: effect\n });\n }\n });\n } catch (error) {\n this.logger.error(`Error when processing action ${nextAction.type}`, {\n error,\n action: nextAction\n });\n } finally {\n this.logger.information(`[processNextAction] action '${nextAction.type} processed.`, nextAction);\n\n // Should not be useful.But, just in case.\n setTimeout(() => this.processNextAction());\n }\n }\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { map, Observable, Subject, distinctUntilChanged, takeUntil } from 'rxjs';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\n@Directive({})\nexport class NgSsmComponent implements OnDestroy {\n private readonly _unsubscribeAll$ = new Subject<void>();\n\n constructor(protected store: Store) {}\n\n protected get unsubscribeAll$(): Observable<void> {\n return this._unsubscribeAll$.asObservable();\n }\n\n public ngOnDestroy(): void {\n this._unsubscribeAll$.next();\n this._unsubscribeAll$.complete();\n }\n\n public watch<T>(selector: (state: State) => T): Observable<T> {\n return this.store.state$.pipe(\n map((state) => selector(state)),\n distinctUntilChanged(),\n takeUntil(this.unsubscribeAll$)\n );\n }\n\n public dispatchAction(action: Action): void {\n this.store.dispatchAction(action);\n }\n\n public dispatchActionType(actionType: string): void {\n this.store.dispatchActionType(actionType);\n }\n}\n","import { BehaviorSubject } from 'rxjs';\nimport { Action } from './action';\n\nexport class StoreMock {\n public state$ = new BehaviorSubject<{ [key: string]: any }>({});\n\n constructor(initialState: { [key: string]: any }) {\n this.state$.next(initialState);\n }\n\n public dispatchAction(action: Action): void {}\n\n public dispatchActionType(type: string): void {}\n}\n","/*\n * Public API Surface of ngssm-store\n */\n\nexport * from './lib/store';\nexport * from './lib/state';\nexport * from './lib/action';\nexport * from './lib/reducer';\nexport * from './lib/effect';\nexport * from './lib/feature-state-specification';\nexport * from './lib/ngssm-component';\nexport * from './lib/state-initializer';\nexport * from './lib/logging';\nexport * from './lib/store-mock';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.Logger","i1.Store"],"mappings":";;;;;MAUa,aAAa,GAAG,IAAI,cAAc,CAAU,eAAe;;MCC3D,YAAY,GAAG,IAAI,cAAc,CAAS,cAAc;;MCJxD,uBAAuB,GAAG,IAAI,cAAc,CAAmB,yBAAyB;;ICPzF,SAIX;AAJD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,QAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EAJW,QAAQ,KAAR,QAAQ,GAInB,EAAA,CAAA,CAAA;;MCKY,MAAM,C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,EAAA,EAAA,CAAA,CAAA;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,SAAS;mBAAC,EAAE,CAAA;;;MCJA,SAAS,CAAA;AAGpB,IAAA,WAAA,CAAY,YAAoC,EAAA;AAFzC,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAAyB,EAAE,CAAC,CAAC;AAG9D,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAChC;IAEM,cAAc,CAAC,MAAc,EAAA,GAAU;IAEvC,kBAAkB,CAAC,IAAY,EAAA,GAAU;AACjD;;ACbD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class NgssmStoreModule {
|
|
4
|
-
}
|
|
5
|
-
NgssmStoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6
|
-
NgssmStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule });
|
|
7
|
-
NgssmStoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule });
|
|
8
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgssmStoreModule, decorators: [{
|
|
9
|
-
type: NgModule,
|
|
10
|
-
args: [{
|
|
11
|
-
declarations: [],
|
|
12
|
-
imports: [],
|
|
13
|
-
exports: []
|
|
14
|
-
}]
|
|
15
|
-
}] });
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdzc20tc3RvcmUubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmdzc20tc3RvcmUvc3JjL2xpYi9uZ3NzbS1zdG9yZS5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFPekMsTUFBTSxPQUFPLGdCQUFnQjs7NkdBQWhCLGdCQUFnQjs4R0FBaEIsZ0JBQWdCOzhHQUFoQixnQkFBZ0I7MkZBQWhCLGdCQUFnQjtrQkFMNUIsUUFBUTttQkFBQztvQkFDUixZQUFZLEVBQUUsRUFBRTtvQkFDaEIsT0FBTyxFQUFFLEVBQUU7b0JBQ1gsT0FBTyxFQUFFLEVBQUU7aUJBQ1oiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtdLFxuICBpbXBvcnRzOiBbXSxcbiAgZXhwb3J0czogW11cbn0pXG5leHBvcnQgY2xhc3MgTmdzc21TdG9yZU1vZHVsZSB7fVxuIl19
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class NgssmStoreModule {
|
|
3
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgssmStoreModule, never>;
|
|
4
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgssmStoreModule, never, never, never>;
|
|
5
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NgssmStoreModule>;
|
|
6
|
-
}
|