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

@nanostores/react

Package Overview
Dependencies
Maintainers
4
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.6.0 to 0.7.0

24

index.d.ts

@@ -1,5 +0,3 @@

import { Store, StoreValue } from 'nanostores'
import type { Store, StoreValue } from 'nanostores'
type AllKeys<T> = T extends any ? keyof T : never
type StoreKeys<T> = T extends { setKey: (k: infer K, v: any) => unknown }

@@ -43,21 +41,1 @@ ? K

): StoreValue<SomeStore>
/**
* Batch React updates. It is just wrap for React’s `unstable_batchedUpdates`
* with fix for React Native.
*
* ```js
* import { batch } from 'nanostores/react'
*
* React.useEffect(() => {
* let unbind = store.listen(() => {
* batch(() => {
* forceRender({})
* })
* })
* })
* ```
*
* @param cb Callback to run in batching.
*/
export function batch(cb: () => void): void

6

index.js

@@ -5,3 +5,3 @@ import { listenKeys } from 'nanostores'

export function useStore(store, opts = {}) {
let sub = useCallback(
let subscribe = useCallback(
onChange =>

@@ -14,5 +14,5 @@ opts.keys

let get = store.get.bind(store)
let get = useCallback(() => store.value, [store])
return useSyncExternalStore(sub, get, get)
return useSyncExternalStore(subscribe, get, get)
}
{
"name": "@nanostores/react",
"version": "0.6.0",
"version": "0.7.0",
"description": "React integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores",

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

"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^16.0.0 || ^18.0.0 || >=20.0.0"
},

@@ -33,5 +33,5 @@ "funding": [

"peerDependencies": {
"nanostores": "^0.8.0",
"nanostores": "^0.9.0",
"react": ">=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