@koordinates/xstate-tree 3.0.0-beta.2 → 3.0.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/README.md +2 -1
- package/lib/xstateTree.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ While xstate-tree manages your application state, it does not have a mechanism f
|
|
|
15
15
|
|
|
16
16
|
At Koordinates we use xstate-tree for all new UI development. Our desktop application, built on top of [Kart](https://kartproject.org/) our Geospatial version control system, is built entirely with xstate-tree using GraphQL for global state.
|
|
17
17
|
|
|
18
|
-
A minimal example of a single machine tree ([CodeSandbox](https://codesandbox.io/s/xstate-tree-b0el6e-forked-4i6txh?file=/src/index.tsx)):
|
|
18
|
+
A minimal example of a single machine tree (See [CodeSandbox](https://codesandbox.io/s/xstate-tree-b0el6e-forked-4i6txh?file=/src/index.tsx) for slightly expanded multi-machine example):
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
21
|
import React from "react";
|
|
@@ -36,6 +36,7 @@ type Events =
|
|
|
36
36
|
type Context = { incremented: number };
|
|
37
37
|
|
|
38
38
|
// If this tree had more than a single machine the slots to render child machines into would be defined here
|
|
39
|
+
// see the codesandbox example for an expanded demonstration that uses slots
|
|
39
40
|
const slots = [];
|
|
40
41
|
|
|
41
42
|
// A standard xstate machine, nothing extra is needed for xstate-tree
|
package/lib/xstateTree.js
CHANGED
|
@@ -237,7 +237,7 @@ export function buildRootComponent(machine, routing) {
|
|
|
237
237
|
// params/query to ensure that all params/query are present
|
|
238
238
|
query: { ...((_a = activeRoutesEvent.query) !== null && _a !== void 0 ? _a : {}) },
|
|
239
239
|
params: { ...((_b = activeRoutesEvent.params) !== null && _b !== void 0 ? _b : {}) },
|
|
240
|
-
meta: { ...((_c = activeRoutesEvent.meta) !== null && _c !== void 0 ? _c : {}) },
|
|
240
|
+
meta: { replace: true, ...((_c = activeRoutesEvent.meta) !== null && _c !== void 0 ? _c : {}) },
|
|
241
241
|
});
|
|
242
242
|
activeRoute.navigate(routeArguments);
|
|
243
243
|
});
|
package/package.json
CHANGED