Socket
Socket
Sign inDemoInstall

simpler-state

Package Overview
Dependencies
5
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-rc.11-pre.0 to 1.0.0-rc.11-pre.4

4

es/useEntity.js

@@ -1,2 +0,2 @@

import { useState, useCallback, useLayoutEffect } from 'react';
import { useState, useCallback, useEffect } from 'react';
import { strictEqual } from './utils';

@@ -14,3 +14,3 @@

}, [transform, equality, state]);
useLayoutEffect(() => entity._subscribe(subscriberFn), [subscriberFn, entity]); // Re-sync state in case transform function has changed
useEffect(() => entity._subscribe(subscriberFn), [subscriberFn, entity]); // Re-sync state in case transform function has changed

@@ -17,0 +17,0 @@ subscriberFn(entity._value);

@@ -6,3 +6,2 @@ /**

*/
export function entity<T = any>(initialValue: T, plugins?: Plugin[]): Entity<T>
export function entity<T = any>(

@@ -12,2 +11,3 @@ initialValue: Promise<T>,

): Entity<T | undefined>
export function entity<T = any>(initialValue: T, plugins?: Plugin[]): Entity<T>

@@ -14,0 +14,0 @@ /**

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

}, [transform, equality, state]);
(0, _react.useLayoutEffect)(function () {
(0, _react.useEffect)(function () {
return entity._subscribe(subscriberFn);

@@ -37,0 +37,0 @@ }, [subscriberFn, entity]); // Re-sync state in case transform function has changed

{
"name": "simpler-state",
"version": "1.0.0-rc.11-pre.0",
"version": "1.0.0-rc.11-pre.4",
"description": "The simplest app state management for React",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc