@koordinates/xstate-tree 2.0.1 → 2.0.2

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.
@@ -30,18 +30,14 @@ export function handleLocationChange(routes, basePath, path, search, setActiveRo
30
30
  route = route.parent;
31
31
  }
32
32
  setActiveRouteEvents([...routingEvents, match.event]);
33
- // Bumps the processing for the state machines to the next event tick
34
- // and out of the popstate handler
35
- setTimeout(() => {
36
- while (routingEvents.length > 0) {
37
- const event = routingEvents.pop();
38
- // copy the originalUrl to all parent events
39
- event.originalUrl = match.event.originalUrl;
40
- // @ts-ignore the event won't match GlobalEvents
41
- broadcast(event);
42
- }
33
+ while (routingEvents.length > 0) {
34
+ const event = routingEvents.pop();
35
+ // copy the originalUrl to all parent events
36
+ event.originalUrl = match.event.originalUrl;
43
37
  // @ts-ignore the event won't match GlobalEvents
44
- broadcast(matchedEvent);
45
- }, 0);
38
+ broadcast(event);
39
+ }
40
+ // @ts-ignore the event won't match GlobalEvents
41
+ broadcast(matchedEvent);
46
42
  }
47
43
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@koordinates/xstate-tree",
3
3
  "main": "lib/index.js",
4
4
  "types": "lib/xstate-tree.d.ts",
5
- "version": "2.0.1",
5
+ "version": "2.0.2",
6
6
  "dependencies": {
7
7
  "@xstate/react": "3.0.0",
8
8
  "fast-memoize": "2.5.2",