@flowerforce/flower-core 3.0.1-beta.1 → 3.0.1-beta.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/dist/index.cjs.js CHANGED
@@ -818,7 +818,7 @@ const FlowerCoreReducers = {
818
818
  }
819
819
  });
820
820
  },
821
- reset: (state, {
821
+ restart: (state, {
822
822
  payload
823
823
  }) => {
824
824
  const {
@@ -831,6 +831,23 @@ const FlowerCoreReducers = {
831
831
  name: name || flowName || ''
832
832
  }
833
833
  });
834
+ },
835
+ reset: (state, {
836
+ payload
837
+ }) => {
838
+ const {
839
+ name,
840
+ flowName,
841
+ initialData
842
+ } = payload;
843
+ FlowerCoreReducers.restoreHistory(state, {
844
+ type: 'restoreHistory',
845
+ payload: {
846
+ name: name || flowName || ''
847
+ }
848
+ });
849
+ _set(state, [name || flowName || '', 'form'], {});
850
+ _set(state, [name || flowName || '', 'data'], initialData);
834
851
  }
835
852
  };
836
853
 
package/dist/index.esm.js CHANGED
@@ -816,7 +816,7 @@ const FlowerCoreReducers = {
816
816
  }
817
817
  });
818
818
  },
819
- reset: (state, {
819
+ restart: (state, {
820
820
  payload
821
821
  }) => {
822
822
  const {
@@ -829,6 +829,23 @@ const FlowerCoreReducers = {
829
829
  name: name || flowName || ''
830
830
  }
831
831
  });
832
+ },
833
+ reset: (state, {
834
+ payload
835
+ }) => {
836
+ const {
837
+ name,
838
+ flowName,
839
+ initialData
840
+ } = payload;
841
+ FlowerCoreReducers.restoreHistory(state, {
842
+ type: 'restoreHistory',
843
+ payload: {
844
+ name: name || flowName || ''
845
+ }
846
+ });
847
+ _set(state, [name || flowName || '', 'form'], {});
848
+ _set(state, [name || flowName || '', 'data'], initialData);
832
849
  }
833
850
  };
834
851
 
@@ -115,9 +115,14 @@ export type ReducersFunctions<T extends Record<string, any> = Record<string, Flo
115
115
  name?: string;
116
116
  flowName?: string;
117
117
  }>;
118
+ restart: ReducerFunctionSign<T, {
119
+ name?: string;
120
+ flowName?: string;
121
+ }>;
118
122
  reset: ReducerFunctionSign<T, {
119
123
  name?: string;
120
124
  flowName?: string;
125
+ initialData?: Record<string, any>;
121
126
  }>;
122
127
  };
123
128
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowerforce/flower-core",
3
- "version": "3.0.1-beta.1",
3
+ "version": "3.0.1-beta.2",
4
4
  "description": "Core functions for flowerJS",
5
5
  "repository": {
6
6
  "type": "git",