@xstate/react 4.0.0 → 4.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.
@@ -54,7 +54,9 @@ function stopRootWithRehydration(actorRef) {
54
54
  // as each subscription should have its own cleanup logic and that should be called each such reconnect
55
55
  ref.observers = new Set();
56
56
  });
57
+ const systemSnapshot = actorRef.system.getSnapshot?.();
57
58
  actorRef.stop();
59
+ actorRef.system._snapshot = systemSnapshot;
58
60
  persistedSnapshots.forEach(([ref, snapshot]) => {
59
61
  ref._processingStatus = 0;
60
62
  ref._snapshot = snapshot;
@@ -54,7 +54,9 @@ function stopRootWithRehydration(actorRef) {
54
54
  // as each subscription should have its own cleanup logic and that should be called each such reconnect
55
55
  ref.observers = new Set();
56
56
  });
57
+ const systemSnapshot = actorRef.system.getSnapshot?.();
57
58
  actorRef.stop();
59
+ actorRef.system._snapshot = systemSnapshot;
58
60
  persistedSnapshots.forEach(([ref, snapshot]) => {
59
61
  ref._processingStatus = 0;
60
62
  ref._snapshot = snapshot;
@@ -28,7 +28,9 @@ function stopRootWithRehydration(actorRef) {
28
28
  // as each subscription should have its own cleanup logic and that should be called each such reconnect
29
29
  ref.observers = new Set();
30
30
  });
31
+ const systemSnapshot = actorRef.system.getSnapshot?.();
31
32
  actorRef.stop();
33
+ actorRef.system._snapshot = systemSnapshot;
32
34
  persistedSnapshots.forEach(([ref, snapshot]) => {
33
35
  ref._processingStatus = 0;
34
36
  ref._snapshot = snapshot;
@@ -28,7 +28,9 @@ function stopRootWithRehydration(actorRef) {
28
28
  // as each subscription should have its own cleanup logic and that should be called each such reconnect
29
29
  ref.observers = new Set();
30
30
  });
31
+ const systemSnapshot = actorRef.system.getSnapshot?.();
31
32
  actorRef.stop();
33
+ actorRef.system._snapshot = systemSnapshot;
32
34
  persistedSnapshots.forEach(([ref, snapshot]) => {
33
35
  ref._processingStatus = 0;
34
36
  ref._snapshot = snapshot;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xstate/react",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "XState tools for React",
5
5
  "keywords": [
6
6
  "state",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
58
- "xstate": "^5.0.0"
58
+ "xstate": "^5.1.0"
59
59
  },
60
60
  "peerDependenciesMeta": {
61
61
  "xstate": {
@@ -76,6 +76,6 @@
76
76
  "jsdom-global": "^3.0.2",
77
77
  "react": "^18.0.0",
78
78
  "react-dom": "^18.0.0",
79
- "xstate": "5.0.0"
79
+ "xstate": "5.1.0"
80
80
  }
81
81
  }