@koordinates/xstate-tree 4.6.0 → 4.6.1
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/lib/utils.js +1 -10
- package/lib/xstateTree.js +1 -1
- package/package.json +1 -1
package/lib/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeMeta = exports.isNil = exports.isEqual = exports.difference = exports.
|
|
3
|
+
exports.mergeMeta = exports.isNil = exports.isEqual = exports.difference = exports.assert = exports.assertIsDefined = exports.delay = void 0;
|
|
4
4
|
function delay(ms = 0) {
|
|
5
5
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
6
|
}
|
|
@@ -26,15 +26,6 @@ function assert(value, msg) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
exports.assert = assert;
|
|
29
|
-
function isLikelyPageLoad() {
|
|
30
|
-
// without performance API, we can't tell if this is a page load
|
|
31
|
-
if (typeof performance === "undefined") {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
// if it's been < 5 seconds since the page was loaded, it's probably a page load
|
|
35
|
-
return performance.now() < 5000;
|
|
36
|
-
}
|
|
37
|
-
exports.isLikelyPageLoad = isLikelyPageLoad;
|
|
38
29
|
function difference(a, b) {
|
|
39
30
|
const result = {};
|
|
40
31
|
for (const key in b) {
|
package/lib/xstateTree.js
CHANGED
|
@@ -334,7 +334,7 @@ function buildRootComponent(machine, routing) {
|
|
|
334
334
|
const { getPathName = () => routing.history.location.pathname, getQueryString = () => routing.history.location.search, } = routing;
|
|
335
335
|
const initialMeta = {
|
|
336
336
|
...((_b = (_a = routing.history.location.state) === null || _a === void 0 ? void 0 : _a.meta) !== null && _b !== void 0 ? _b : {}),
|
|
337
|
-
onloadEvent:
|
|
337
|
+
onloadEvent: true,
|
|
338
338
|
};
|
|
339
339
|
const queryString = getQueryString();
|
|
340
340
|
const result = (0, routing_1.handleLocationChange)(routing.routes, routing.basePath, getPathName(), getQueryString(), initialMeta);
|
package/package.json
CHANGED