@growupsell/commerce 1.0.0-alpha.2 → 1.0.0-alpha.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/{checkout-CwpFl6qt.d.ts → checkout-DDNMdKbR.d.ts} +27 -3
- package/dist/{chunk-AI2CWQ22.js → chunk-BORVKACK.js} +12 -4
- package/dist/chunk-BORVKACK.js.map +1 -0
- package/dist/{chunk-DHBRITDW.js → chunk-HGCKDE7D.js} +16 -8
- package/dist/chunk-HGCKDE7D.js.map +1 -0
- package/dist/{client-D4JNDM6j.d.ts → client-RzekAHeO.d.ts} +2 -9
- package/dist/http/index.d.ts +2 -2
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/rules/index.d.ts +1 -1
- package/dist/{sku-C3SGyRqT.d.ts → sku-ViHXTvEw.d.ts} +1 -1
- package/dist/stores/index.d.ts +8 -1
- package/dist/stores/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-AI2CWQ22.js.map +0 -1
- package/dist/chunk-DHBRITDW.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GrowupsellApiError,
|
|
3
3
|
createClient
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BORVKACK.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_LISTING_CRITERIA,
|
|
7
7
|
LISTING_PAGE_SIZE,
|
|
@@ -1092,14 +1092,22 @@ function createCatalogStore(ctx) {
|
|
|
1092
1092
|
ctx.events.emit({ type: "error", store: "catalog", action: "load", error });
|
|
1093
1093
|
return fail(error);
|
|
1094
1094
|
}
|
|
1095
|
+
function load(options = {}) {
|
|
1096
|
+
if (options.force) return run(["categories", "settings"]);
|
|
1097
|
+
const missing = ["categories", "settings"].filter((part) => !loaded[part]);
|
|
1098
|
+
if (missing.length === 0) return Promise.resolve(ok(void 0));
|
|
1099
|
+
return flight("load", () => run(missing));
|
|
1100
|
+
}
|
|
1095
1101
|
return {
|
|
1096
1102
|
...readOnly(store),
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
+
subscribe(listener) {
|
|
1104
|
+
const unsubscribe = store.subscribe(listener);
|
|
1105
|
+
if (ctx.config.autoLoad && !ctx.isDisposed() && store.getSnapshot().status === "idle") {
|
|
1106
|
+
void load();
|
|
1107
|
+
}
|
|
1108
|
+
return unsubscribe;
|
|
1109
|
+
},
|
|
1110
|
+
load
|
|
1103
1111
|
};
|
|
1104
1112
|
}
|
|
1105
1113
|
|
|
@@ -2977,4 +2985,4 @@ export {
|
|
|
2977
2985
|
REFERRAL_TTL_MS,
|
|
2978
2986
|
createGrowupsellStores
|
|
2979
2987
|
};
|
|
2980
|
-
//# sourceMappingURL=chunk-
|
|
2988
|
+
//# sourceMappingURL=chunk-HGCKDE7D.js.map
|