@koordinates/xstate-tree 4.1.0-beta.1 → 4.1.0-beta.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.
@@ -153,7 +153,7 @@ export function buildCreateRoute(history, basePath) {
153
153
  navigate({
154
154
  url: joinRoutes(this.basePath, url),
155
155
  meta,
156
- history: this.history,
156
+ history: this.history(),
157
157
  });
158
158
  },
159
159
  };
@@ -41,7 +41,7 @@ export declare type AnyRoute = {
41
41
  getEvent: any;
42
42
  event: string;
43
43
  basePath: string;
44
- history: XstateTreeHistory;
44
+ history: () => XstateTreeHistory;
45
45
  parent?: AnyRoute;
46
46
  paramsSchema?: Z.ZodObject<any>;
47
47
  querySchema?: Z.ZodObject<any>;
@@ -100,7 +100,7 @@ export declare function buildActions<TMachine extends AnyStateMachine, TActions,
100
100
  * @param history - the history object to use for this route factory, this needs to be the same one used in the trees root component
101
101
  * @param basePath - the base path for this route factory
102
102
  */
103
- export declare function buildCreateRoute(history: XstateTreeHistory, basePath: string): {
103
+ export declare function buildCreateRoute(history: () => XstateTreeHistory, basePath: string): {
104
104
  simpleRoute<TBaseRoute extends AnyRoute>(baseRoute?: TBaseRoute | undefined): <TEvent extends string, TParamsSchema extends Z.ZodObject<any, "strip", Z.ZodTypeAny, {
105
105
  [x: string]: any;
106
106
  }, {
@@ -529,7 +529,7 @@ export declare type Route<TParams, TQuery, TEvent, TMeta> = {
529
529
  * Event type for this route
530
530
  */
531
531
  event: TEvent;
532
- history: XstateTreeHistory;
532
+ history: () => XstateTreeHistory;
533
533
  basePath: string;
534
534
  parent?: AnyRoute;
535
535
  paramsSchema?: Z.ZodObject<any>;
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": "4.1.0-beta.1",
5
+ "version": "4.1.0-beta.2",
6
6
  "license": "MIT",
7
7
  "description": "Build UIs with Actors using xstate and React",
8
8
  "keywords": [