as-model 0.4.1 → 0.4.3

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.js CHANGED
@@ -1294,6 +1294,21 @@ function createStore(modelLike) {
1294
1294
  getStoreInstance: function getStoreInstance() {
1295
1295
  return extractInstance(updater, void 0, propertiesCache);
1296
1296
  },
1297
+ config: function config4(customizedConfig) {
1298
+ updater.mutate(function(u) {
1299
+ var middleWares = customizedConfig.middleWares, rest = _object_without_properties(customizedConfig, [
1300
+ "middleWares"
1301
+ ]);
1302
+ var updaterConfig = u.config;
1303
+ var nextUpdaterConfig = _object_spread({}, updaterConfig, rest);
1304
+ return _object_spread_props(_object_spread({}, u), {
1305
+ config: nextUpdaterConfig
1306
+ });
1307
+ });
1308
+ },
1309
+ getConfiguration: function getConfiguration() {
1310
+ return updater.config;
1311
+ },
1297
1312
  update: function update(args) {
1298
1313
  var updateArgs = args !== null && args !== void 0 ? args : {};
1299
1314
  if (updateArgs.key) {
@@ -109,6 +109,17 @@ function createStore(modelLike, config = {}) {
109
109
  getStoreInstance() {
110
110
  return extractInstance(updater, void 0, propertiesCache);
111
111
  },
112
+ config(customizedConfig) {
113
+ updater.mutate((u) => {
114
+ const _a = customizedConfig, { middleWares } = _a, rest = __objRest(_a, ["middleWares"]);
115
+ const updaterConfig = u.config;
116
+ const nextUpdaterConfig = __spreadValues(__spreadValues({}, updaterConfig), rest);
117
+ return __spreadProps(__spreadValues({}, u), { config: nextUpdaterConfig });
118
+ });
119
+ },
120
+ getConfiguration() {
121
+ return updater.config;
122
+ },
112
123
  update(args) {
113
124
  const updateArgs = args != null ? args : {};
114
125
  if (updateArgs.key) {
@@ -153,5 +153,6 @@ function createUpdater(model, middleWare, config = {}) {
153
153
  return updater;
154
154
  }
155
155
  export {
156
+ createUpdateFn,
156
157
  createUpdater
157
158
  };
package/index.d.ts CHANGED
@@ -110,6 +110,8 @@ export declare interface Store<
110
110
  state?: PickState<M>;
111
111
  silence?: boolean;
112
112
  }) => void;
113
+ config: (customizedConfig: Config) => void;
114
+ getConfiguration: () => Config | undefined;
113
115
  destroy: () => void;
114
116
  payload: <P>(
115
117
  callback?: (payload: P | undefined) => P | undefined
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "as-model",
4
- "version": "0.4.1",
4
+ "version": "0.4.3",
5
5
  "description": "This is a model state management tool",
6
6
  "license": "MIT",
7
7
  "author": "Jimmy.Harding",