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 +15 -0
- package/esm/store/index.js +11 -0
- package/esm/updater/index.js +1 -0
- package/index.d.ts +2 -0
- package/package.json +1 -1
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) {
|
package/esm/store/index.js
CHANGED
|
@@ -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) {
|
package/esm/updater/index.js
CHANGED
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
|