as-model 0.3.3 → 0.3.4
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 +2 -2
- package/esm/key/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1362,10 +1362,10 @@ function createStores(modelKeys) {
|
|
|
1362
1362
|
destroyed: false
|
|
1363
1363
|
};
|
|
1364
1364
|
var storeUnits = modelKeys.map(function(modelKey) {
|
|
1365
|
-
if (typeof modelKey === "function") {
|
|
1365
|
+
if (typeof modelKey === "function" && typeof modelKey.createStore === "function") {
|
|
1366
1366
|
return modelKey.createStore();
|
|
1367
1367
|
}
|
|
1368
|
-
var k = modelKey.key;
|
|
1368
|
+
var k = typeof modelKey === "function" ? modelKey : modelKey.key;
|
|
1369
1369
|
return createStore(k, "defaultState" in k ? _object_spread_props(_object_spread({}, config2), {
|
|
1370
1370
|
state: k.defaultState
|
|
1371
1371
|
}) : config2);
|
package/esm/key/index.js
CHANGED
|
@@ -33,10 +33,10 @@ createKey.isModelKey = isModelKey;
|
|
|
33
33
|
function createStores(modelKeys, config = {}) {
|
|
34
34
|
const state = { destroyed: false };
|
|
35
35
|
const storeUnits = modelKeys.map((modelKey) => {
|
|
36
|
-
if (typeof modelKey === "function") {
|
|
36
|
+
if (typeof modelKey === "function" && typeof modelKey.createStore === "function") {
|
|
37
37
|
return modelKey.createStore();
|
|
38
38
|
}
|
|
39
|
-
const k = modelKey.key;
|
|
39
|
+
const k = typeof modelKey === "function" ? modelKey : modelKey.key;
|
|
40
40
|
return createStore(
|
|
41
41
|
k,
|
|
42
42
|
"defaultState" in k ? __spreadProps(__spreadValues({}, config), { state: k.defaultState }) : config
|