ntk-cms-api 18.3.425 → 18.3.426

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Component, NgModule, Inject } from '@angular/core';
3
- import { Subject, BehaviorSubject, throwError, of } from 'rxjs';
3
+ import { BehaviorSubject, throwError, of } from 'rxjs';
4
4
  import { distinctUntilChanged, map, retry } from 'rxjs/operators';
5
5
  import * as i2 from '@angular/common/http';
6
6
  import { HttpClient } from '@angular/common/http';
@@ -56,7 +56,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
56
56
  // ----------------------------------------------------------------------------------- //
57
57
  class CmsStore {
58
58
  constructor(initialState) {
59
- this.sub = new Subject();
60
59
  this.state = initialState;
61
60
  this.stateSubject = new BehaviorSubject(initialState);
62
61
  // @ts-ignore
@@ -68,7 +67,7 @@ class CmsStore {
68
67
  setState(partialState) {
69
68
  const currentState = this.getStateSnapshot();
70
69
  this.state = Object.assign({}, currentState, partialState);
71
- this.sub.next(this.state);
70
+ //this.sub.next(this.state);
72
71
  this.stateSubject.next(this.state);
73
72
  }
74
73
  getStateDirect() {
@@ -78,7 +77,7 @@ class CmsStore {
78
77
  if (typeof mapFn !== 'function') {
79
78
  throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
80
79
  }
81
- return this.sub.asObservable()
80
+ return this.stateSubject.asObservable()
82
81
  .pipe(map(mapFn))
83
82
  .pipe(distinctUntilChanged());
84
83
  }
@@ -146,7 +145,6 @@ class SetProcessInfoStore {
146
145
 
147
146
  class NtkCmsApiStoreService {
148
147
  constructor() {
149
- this.sub = new Subject();
150
148
  this.state = {
151
149
  ntkCmsAPiState: initialState,
152
150
  };
@@ -159,14 +157,14 @@ class NtkCmsApiStoreService {
159
157
  }
160
158
  setState(param) {
161
159
  Object.assign(this.state.ntkCmsAPiState, stateReducer(this.state.ntkCmsAPiState, param));
162
- this.sub.next(this.state);
160
+ //this.sub.next(this.state);
163
161
  this.stateSubject.next(this.state);
164
162
  }
165
163
  getState(mapFn) {
166
164
  if (typeof mapFn !== 'function') {
167
165
  throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
168
166
  }
169
- return this.sub.asObservable()
167
+ return this.stateSubject.asObservable()
170
168
  .pipe(map(mapFn))
171
169
  .pipe(distinctUntilChanged());
172
170
  }