@xstate/react
Advanced tools
Comparing version 4.0.0-alpha.2 to 4.0.0-beta.3
@@ -18,9 +18,2 @@ 'use strict'; | ||
} | ||
var getServiceState = function getServiceState(service) { | ||
var currentValue; | ||
service.subscribe(function (state) { | ||
currentValue = state; | ||
}).unsubscribe(); | ||
return currentValue; | ||
}; | ||
function useMachine(stateMachine, options) { | ||
@@ -76,3 +69,3 @@ var persistedStateRef = React.useRef(); | ||
var getSnapshot = React.useCallback(function () { | ||
return getServiceState(service); | ||
return service.state; | ||
}, [service]); | ||
@@ -79,0 +72,0 @@ var subscribe = React.useCallback(function (handleStoreChange) { |
@@ -73,9 +73,2 @@ 'use strict'; | ||
} | ||
var getServiceState = function getServiceState(service) { | ||
var currentValue; | ||
service.subscribe(function (state) { | ||
currentValue = state; | ||
}).unsubscribe(); | ||
return currentValue; | ||
}; | ||
function useMachine(stateMachine, options) { | ||
@@ -123,3 +116,3 @@ var persistedStateRef = React.useRef(); | ||
var getSnapshot = React.useCallback(function () { | ||
return getServiceState(service); | ||
return service.state; | ||
}, [service]); | ||
@@ -126,0 +119,0 @@ var subscribe = React.useCallback(function (handleStoreChange) { |
@@ -10,9 +10,2 @@ import { _ as _slicedToArray, u as useConstant } from '../../dist/useConstant-0013a606.esm.js'; | ||
} | ||
var getServiceState = function getServiceState(service) { | ||
var currentValue; | ||
service.subscribe(function (state) { | ||
currentValue = state; | ||
}).unsubscribe(); | ||
return currentValue; | ||
}; | ||
function useMachine(stateMachine, options) { | ||
@@ -68,3 +61,3 @@ var persistedStateRef = useRef(); | ||
var getSnapshot = useCallback(function () { | ||
return getServiceState(service); | ||
return service.state; | ||
}, [service]); | ||
@@ -71,0 +64,0 @@ var subscribe = useCallback(function (handleStoreChange) { |
{ | ||
"name": "@xstate/react", | ||
"version": "4.0.0-alpha.2", | ||
"version": "4.0.0-beta.3", | ||
"description": "XState tools for React", | ||
@@ -46,5 +46,5 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@xstate/fsm": "^3.0.0-alpha.0", | ||
"@xstate/fsm": "^3.0.0-beta.2", | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0", | ||
"xstate": "^5.0.0-alpha.3" | ||
"xstate": "^5.0.0-beta.7" | ||
}, | ||
@@ -69,3 +69,3 @@ "peerDependenciesMeta": { | ||
"@types/use-sync-external-store": "^0.0.3", | ||
"@xstate/fsm": "3.0.0-alpha.0", | ||
"@xstate/fsm": "3.0.0-beta.2", | ||
"jsdom": "^14.0.0", | ||
@@ -75,3 +75,3 @@ "jsdom-global": "^3.0.2", | ||
"react-dom": "^18.0.0", | ||
"xstate": "5.0.0-alpha.3" | ||
"xstate": "5.0.0-beta.7" | ||
}, | ||
@@ -78,0 +78,0 @@ "preconstruct": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60010
1405