@statelyai/sky-react
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -17,8 +17,15 @@ 'use strict'; | ||
react.useEffect(() => { | ||
const subscription = xstate.createActor(xstate.fromPromise(() => sky.actorFromStately(options, skyConfig))).start().subscribe(s => { | ||
s.output?.start(); | ||
return setMaybeActor(s.output); | ||
}); | ||
return () => subscription.unsubscribe(); | ||
const subscription = xstate.createActor(xstate.fromPromise(() => sky.actorFromStately(options, skyConfig))).start().subscribe(({ | ||
output | ||
}) => setMaybeActor(output)); | ||
return () => { | ||
return subscription.unsubscribe(); | ||
}; | ||
}, [options.url, options.sessionId, skyConfig]); | ||
react.useEffect(() => { | ||
maybeActor?.start(); | ||
return () => { | ||
maybeActor?.stop(); | ||
}; | ||
}, [maybeActor]); | ||
const send = maybeActor?.send; | ||
@@ -25,0 +32,0 @@ const isConnecting = send === undefined; |
@@ -13,8 +13,15 @@ import { actorFromStately } from '@statelyai/sky'; | ||
useEffect(() => { | ||
const subscription = createActor(fromPromise(() => actorFromStately(options, skyConfig))).start().subscribe(s => { | ||
s.output?.start(); | ||
return setMaybeActor(s.output); | ||
}); | ||
return () => subscription.unsubscribe(); | ||
const subscription = createActor(fromPromise(() => actorFromStately(options, skyConfig))).start().subscribe(({ | ||
output | ||
}) => setMaybeActor(output)); | ||
return () => { | ||
return subscription.unsubscribe(); | ||
}; | ||
}, [options.url, options.sessionId, skyConfig]); | ||
useEffect(() => { | ||
maybeActor?.start(); | ||
return () => { | ||
maybeActor?.stop(); | ||
}; | ||
}, [maybeActor]); | ||
const send = maybeActor?.send; | ||
@@ -21,0 +28,0 @@ const isConnecting = send === undefined; |
{ | ||
"name": "@statelyai/sky-react", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "", | ||
@@ -33,3 +33,3 @@ "main": "dist/statelyai-sky-react.cjs.js", | ||
"dependencies": { | ||
"@statelyai/sky": "0.0.8", | ||
"@statelyai/sky": "0.0.9", | ||
"@xstate/react": "4.0.0-beta.10", | ||
@@ -36,0 +36,0 @@ "xstate": "5.0.0-beta.37" |
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
4605
78
+ Added@statelyai/sky@0.0.9(transitive)
- Removed@statelyai/sky@0.0.8(transitive)
Updated@statelyai/sky@0.0.9