@push.rocks/smartstate 2.0.14 → 2.0.15

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.
@@ -11062,21 +11062,21 @@ var StateAction = class {
11062
11062
  // ts/smartstate.classes.statepart.ts
11063
11063
  var StatePart2 = class {
11064
11064
  // Add WebStore instance
11065
- constructor(nameArg, webStoreOptions) {
11065
+ constructor(nameArg, webStoreOptionsArg) {
11066
11066
  this.state = new dist_ts_exports7.rxjs.Subject();
11067
11067
  this.cumulativeDeferred = dist_ts_exports6.cumulativeDefer();
11068
11068
  this.webStore = null;
11069
11069
  this.name = nameArg;
11070
- if (webStoreOptions) {
11071
- this.webStore = new dist_ts_exports13.WebStore(webStoreOptions);
11072
- this.initWebStore();
11070
+ if (webStoreOptionsArg) {
11071
+ this.webStoreOptions = webStoreOptionsArg;
11073
11072
  }
11074
11073
  }
11075
11074
  /**
11076
11075
  * initializes the webstore
11077
11076
  */
11078
- async initWebStore() {
11079
- if (this.webStore) {
11077
+ async init() {
11078
+ if (this.webStoreOptions) {
11079
+ this.webStore = new dist_ts_exports13.WebStore(this.webStoreOptions);
11080
11080
  await this.webStore.init();
11081
11081
  const storedState = await this.webStore.get(String(this.name));
11082
11082
  if (storedState) {
@@ -11225,6 +11225,7 @@ var Smartstate = class {
11225
11225
  storeName: statePartName
11226
11226
  } : null
11227
11227
  );
11228
+ await newState.init();
11228
11229
  const currentState = newState.getState();
11229
11230
  await newState.setState({
11230
11231
  ...initialPayloadArg,