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

react-svelte-stores

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-svelte-stores - npm Package Compare versions

Comparing version 0.1.2 to 0.1.4

2

build/hooks.d.ts

@@ -6,3 +6,3 @@ import { IStore } from "./types";

/** Selector to prevent unnecesary re-renders. Used when store value is not a primitive. Use memoized selectors if your selector involves expensive computations */
export declare const useSelectedStoreState: <T, R>(store: IStore<T>, selector: Selector<T, R>) => R;
export declare const useSelectedStoreState: <T, R>(store: IStore<T>, selector: Selector<T, R>, selectorDeps?: import("react").DependencyList) => R;
export {};

@@ -15,3 +15,3 @@ "use strict";

/** Selector to prevent unnecesary re-renders. Used when store value is not a primitive. Use memoized selectors if your selector involves expensive computations */
exports.useSelectedStoreState = (store, selector) => {
exports.useSelectedStoreState = (store, selector, selectorDeps) => {
const [state, setState] = react_1.useState(selector(stores_1.get(store)));

@@ -22,3 +22,6 @@ react_1.useLayoutEffect(() => {

}, []);
react_1.useEffect(() => {
setState(selector(stores_1.get(store)));
}, selectorDeps ? selectorDeps : []);
return state;
};
{
"name": "react-svelte-stores",
"version": "0.1.2",
"version": "0.1.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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