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

@nanostores/react

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nanostores/react - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

15

index.js
import { listenKeys } from 'nanostores'
import React from 'react'
import { batch } from './batch/index.js'
export { batch }
export function useStore(store, opts = {}) {

@@ -21,11 +17,10 @@ let [, forceRender] = React.useState({})

React.useEffect(() => {
let rerender = () => {
batch(() => {
if (opts.keys) {
return listenKeys(store, opts.keys, () => {
forceRender({})
})
}
if (opts.keys) {
return listenKeys(store, opts.keys, rerender)
} else {
return store.listen(rerender)
return store.listen(() => {
forceRender({})
})
}

@@ -32,0 +27,0 @@ }, [store, '' + opts.keys])

{
"name": "@nanostores/react",
"version": "0.1.5",
"version": "0.2.0",
"description": "React integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores",

@@ -22,5 +22,2 @@ "keywords": [

},
"react-native": {
"./batch/index.js": "./batch/index.native.js"
},
"engines": {

@@ -31,5 +28,5 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"

"nanostores": "^0.5.2",
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
}
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