Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tanstack/react-store

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/react-store - npm Package Compare versions

Comparing version 0.0.1-beta.113 to 0.0.1-beta.118

23

build/cjs/index.js

@@ -19,3 +19,26 @@ /**

function useStore(store, selector = d => d) {
// const isMountedRef = React.useRef(false)
// const [state, setState] = React.useState<{ ref: TSelected }>({
// ref: undefined!,
// })
const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, shallow);
// if (!isMountedRef.current) {
// state.ref = slice
// }
// if (slice !== state.ref) {
// setState({ ref: slice })
// }
// React.useEffect(() => {
// isMountedRef.current = true
// return () => {
// isMountedRef.current = false
// }
// }, [])
// return state.ref
return slice;

@@ -22,0 +45,0 @@ }

@@ -15,3 +15,26 @@ /**

function useStore(store, selector = d => d) {
// const isMountedRef = React.useRef(false)
// const [state, setState] = React.useState<{ ref: TSelected }>({
// ref: undefined!,
// })
const slice = useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, shallow);
// if (!isMountedRef.current) {
// state.ref = slice
// }
// if (slice !== state.ref) {
// setState({ ref: slice })
// }
// React.useEffect(() => {
// isMountedRef.current = true
// return () => {
// isMountedRef.current = false
// }
// }, [])
// return state.ref
return slice;

@@ -18,0 +41,0 @@ }

34

build/stats-react.json

@@ -14,7 +14,7 @@ {

"name": "store/build/esm/index.js",
"uid": "5eea-10"
"uid": "e526-10"
},
{
"name": "react-store/src/index.tsx",
"uid": "5eea-12"
"uid": "e526-12"
}

@@ -29,20 +29,20 @@ ]

"nodeParts": {
"5eea-10": {
"e526-10": {
"renderedLength": 1359,
"gzipLength": 537,
"brotliLength": 0,
"mainUid": "5eea-9"
"mainUid": "e526-9"
},
"5eea-12": {
"renderedLength": 754,
"gzipLength": 343,
"e526-12": {
"renderedLength": 1244,
"gzipLength": 505,
"brotliLength": 0,
"mainUid": "5eea-11"
"mainUid": "e526-11"
}
},
"nodeMetas": {
"5eea-9": {
"e526-9": {
"id": "/packages/store/build/esm/index.js",
"moduleParts": {
"index.production.js": "5eea-10"
"index.production.js": "e526-10"
},

@@ -52,17 +52,17 @@ "imported": [],

{
"uid": "5eea-11"
"uid": "e526-11"
}
]
},
"5eea-11": {
"e526-11": {
"id": "/packages/react-store/src/index.tsx",
"moduleParts": {
"index.production.js": "5eea-12"
"index.production.js": "e526-12"
},
"imported": [
{
"uid": "5eea-13"
"uid": "e526-13"
},
{
"uid": "5eea-9"
"uid": "e526-9"
}

@@ -73,3 +73,3 @@ ],

},
"5eea-13": {
"e526-13": {
"id": "use-sync-external-store/shim/with-selector",

@@ -80,3 +80,3 @@ "moduleParts": {},

{
"uid": "5eea-11"
"uid": "e526-11"
}

@@ -83,0 +83,0 @@ ],

@@ -71,3 +71,26 @@ /**

function useStore(store, selector = d => d) {
// const isMountedRef = React.useRef(false)
// const [state, setState] = React.useState<{ ref: TSelected }>({
// ref: undefined!,
// })
const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, shallow);
// if (!isMountedRef.current) {
// state.ref = slice
// }
// if (slice !== state.ref) {
// setState({ ref: slice })
// }
// React.useEffect(() => {
// isMountedRef.current = true
// return () => {
// isMountedRef.current = false
// }
// }, [])
// return state.ref
return slice;

@@ -74,0 +97,0 @@ }

{
"name": "@tanstack/react-store",
"author": "Tanner Linsley",
"version": "0.0.1-beta.113",
"version": "0.0.1-beta.118",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "tanstack/react-store",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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