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

@xstate/react

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xstate/react - npm Package Compare versions

Comparing version 4.0.3 to 4.1.0

2

dist/declarations/src/useSelector.d.ts
import { ActorRef, SnapshotFrom } from 'xstate';
export declare function useSelector<TActor extends ActorRef<any, any>, T>(actor: TActor, selector: (emitted: SnapshotFrom<TActor>) => T, compare?: (a: T, b: T) => boolean): T;
export declare function useSelector<TActor extends ActorRef<any, any> | undefined, T>(actor: TActor, selector: (emitted: TActor extends ActorRef<any, any> ? SnapshotFrom<TActor> : undefined) => T, compare?: (a: T, b: T) => boolean): T;

@@ -134,2 +134,5 @@ 'use strict';

const subscribe = React.useCallback(handleStoreChange => {
if (!actor) {
return () => {};
}
const {

@@ -140,3 +143,3 @@ unsubscribe

}, [actor]);
const boundGetSnapshot = React.useCallback(() => actor.getSnapshot(), [actor]);
const boundGetSnapshot = React.useCallback(() => actor?.getSnapshot(), [actor]);
const selectedSnapshot = withSelector.useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);

@@ -143,0 +146,0 @@ return selectedSnapshot;

@@ -137,2 +137,5 @@ 'use strict';

const subscribe = React.useCallback(handleStoreChange => {
if (!actor) {
return () => {};
}
const {

@@ -143,3 +146,3 @@ unsubscribe

}, [actor]);
const boundGetSnapshot = React.useCallback(() => actor.getSnapshot(), [actor]);
const boundGetSnapshot = React.useCallback(() => actor?.getSnapshot(), [actor]);
const selectedSnapshot = withSelector.useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);

@@ -146,0 +149,0 @@ return selectedSnapshot;

@@ -111,2 +111,5 @@ import * as React from 'react';

const subscribe = useCallback(handleStoreChange => {
if (!actor) {
return () => {};
}
const {

@@ -117,3 +120,3 @@ unsubscribe

}, [actor]);
const boundGetSnapshot = useCallback(() => actor.getSnapshot(), [actor]);
const boundGetSnapshot = useCallback(() => actor?.getSnapshot(), [actor]);
const selectedSnapshot = useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);

@@ -120,0 +123,0 @@ return selectedSnapshot;

@@ -108,2 +108,5 @@ import * as React from 'react';

const subscribe = useCallback(handleStoreChange => {
if (!actor) {
return () => {};
}
const {

@@ -114,3 +117,3 @@ unsubscribe

}, [actor]);
const boundGetSnapshot = useCallback(() => actor.getSnapshot(), [actor]);
const boundGetSnapshot = useCallback(() => actor?.getSnapshot(), [actor]);
const selectedSnapshot = useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);

@@ -117,0 +120,0 @@ return selectedSnapshot;

{
"name": "@xstate/react",
"version": "4.0.3",
"version": "4.1.0",
"description": "XState tools for React",

@@ -58,3 +58,3 @@ "keywords": [

"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"xstate": "^5.5.2"
"xstate": "^5.6.2"
},

@@ -80,4 +80,4 @@ "peerDependenciesMeta": {

"react-dom": "^18.0.0",
"xstate": "5.5.2"
"xstate": "5.6.2"
}
}
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