New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@statelyai/sky-react

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@statelyai/sky-react - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

11

dist/declarations/src/useStatelyActor.d.ts

@@ -1,8 +0,5 @@

import { SkyConfigFile } from '@statelyai/sky';
import { SkyConfigFile, actorFromStately } from '@statelyai/sky';
import { Actor, AnyStateMachine } from 'xstate';
export declare function useStatelyActor<T extends AnyStateMachine>({ apiKey, url, sessionId, runOnSky, }: {
apiKey?: string;
url: string;
sessionId: string;
runOnSky?: boolean;
}, skyConfig?: SkyConfigFile<T>): readonly [import("xstate").SnapshotFrom<T>, ((event: import("xstate").EventFromLogic<T>) => void) | undefined, Actor<T> | undefined];
export declare function useStatelyActor<T extends AnyStateMachine>(options: Parameters<typeof actorFromStately>[0], skyConfig?: SkyConfigFile<T>): readonly [import("xstate").SnapshotFrom<T>, ((event: import("xstate").EventFromLogic<T>) => void) | undefined, Actor<T> | undefined, {
isConnecting: boolean;
}];

@@ -10,10 +10,5 @@ 'use strict';

function useStatelyActor({
apiKey,
url,
sessionId,
runOnSky = true
}, skyConfig) {
function useStatelyActor(options, skyConfig) {
if (!skyConfig) {
throw new Error(`You need to run xstate sky "src/**/*.ts?(x)" before you can use the Stately Sky actor with url ${url}`);
throw new Error(`You need to run xstate sky "src/**/*.ts?(x)" before you can use the Stately Sky actor with url ${options.url}`);
}

@@ -23,8 +18,3 @@ const [maybeActor, setMaybeActor] = react.useState();

react.useEffect(() => {
const subscription = xstate.createActor(xstate.fromPromise(() => sky.actorFromStately({
url,
apiKey,
sessionId,
runOnSky
}, skyConfig))).start().subscribe(s => {
const subscription = xstate.createActor(xstate.fromPromise(() => sky.actorFromStately(options, skyConfig))).start().subscribe(s => {
s.output?.start();

@@ -34,6 +24,11 @@ return setMaybeActor(s.output);

return () => subscription.unsubscribe();
}, [apiKey, runOnSky, sessionId, skyConfig, url]);
return [state, maybeActor?.send, maybeActor];
}, [options.url, options.sessionId, skyConfig]);
const send = maybeActor?.send;
const isConnecting = send === undefined;
const sky$1 = {
isConnecting
};
return [state, send, maybeActor, sky$1];
}
exports.useStatelyActor = useStatelyActor;

@@ -6,10 +6,5 @@ import { actorFromStately } from '@statelyai/sky';

function useStatelyActor({
apiKey,
url,
sessionId,
runOnSky = true
}, skyConfig) {
function useStatelyActor(options, skyConfig) {
if (!skyConfig) {
throw new Error(`You need to run xstate sky "src/**/*.ts?(x)" before you can use the Stately Sky actor with url ${url}`);
throw new Error(`You need to run xstate sky "src/**/*.ts?(x)" before you can use the Stately Sky actor with url ${options.url}`);
}

@@ -19,8 +14,3 @@ const [maybeActor, setMaybeActor] = useState();

useEffect(() => {
const subscription = createActor(fromPromise(() => actorFromStately({
url,
apiKey,
sessionId,
runOnSky
}, skyConfig))).start().subscribe(s => {
const subscription = createActor(fromPromise(() => actorFromStately(options, skyConfig))).start().subscribe(s => {
s.output?.start();

@@ -30,6 +20,11 @@ return setMaybeActor(s.output);

return () => subscription.unsubscribe();
}, [apiKey, runOnSky, sessionId, skyConfig, url]);
return [state, maybeActor?.send, maybeActor];
}, [options.url, options.sessionId, skyConfig]);
const send = maybeActor?.send;
const isConnecting = send === undefined;
const sky = {
isConnecting
};
return [state, send, maybeActor, sky];
}
export { useStatelyActor };
{
"name": "@statelyai/sky-react",
"version": "0.0.4",
"version": "0.0.5",
"description": "",

@@ -33,5 +33,5 @@ "main": "dist/statelyai-sky-react.cjs.js",

"dependencies": {
"@statelyai/sky": "0.0.4",
"@statelyai/sky": "0.0.5",
"@xstate/react": "4.0.0-beta.10",
"xstate": "5.0.0-beta.33"
"xstate": "5.0.0-beta.37"
},

@@ -38,0 +38,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc