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

@contember/react-utils

Package Overview
Dependencies
Maintainers
5
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/react-utils - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0-alpha.0

dist/development/referentiallyStable/useReferentiallyStableCallback.js

2

dist/development/hooks/useArrayMapMemo.js
import { useMemo } from "react";
import { useConstantLengthInvariant } from "./useConstantLengthInvariant.js";
const useArrayMapMemo = (items, map) => {
useConstantLengthInvariant(items);
const mapped = useMemo(() => items.map(map), [map, ...items]);

@@ -6,0 +4,0 @@ return useMemo(() => mapped, mapped);

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

import { usePreviousValue } from "./usePreviousValue.js";
const useConstantLengthInvariant = (items, message) => {
{
const previous = usePreviousValue(items);
if (previous.length !== items.length) {
throw new Error(
`Invariant violation: ${message || "Changing the length of an array whose length must remain constant between renders."}`
);
}
}
};

@@ -12,0 +3,0 @@ export {

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

import { usePreviousValue } from "./usePreviousValue.js";
const useConstantValueInvariant = (value, message) => {
{
const previous = usePreviousValue(value);
if (previous !== value) {
throw new Error(
`Invariant violation: ${message || "Changing a value which must remain constant between renders."}`
);
}
}
};

@@ -12,0 +3,0 @@ export {

@@ -7,3 +7,3 @@ import { useRef, useEffect, useCallback } from "react";

useEffect(() => {
return () => timerRef.current && clearTimeout(timerRef.current);
return () => clearTimeout(timerRef.current);
}, []);

@@ -10,0 +10,0 @@ return useCallback(() => {

@@ -18,2 +18,3 @@ import { useAbortController } from "./hooks/useAbortController.js";

import { returnTrue } from "./referentiallyStable/returnTrue.js";
import { useReferentiallyStableCallback } from "./referentiallyStable/useReferentiallyStableCallback.js";
export {

@@ -36,4 +37,5 @@ emptyArray,

usePreviousValue,
useReferentiallyStableCallback,
useSessionStorageState
};
//# sourceMappingURL=index.js.map

@@ -7,3 +7,3 @@ import { useRef, useEffect, useCallback } from "react";

useEffect(() => {
return () => timerRef.current && clearTimeout(timerRef.current);
return () => clearTimeout(timerRef.current);
}, []);

@@ -10,0 +10,0 @@ return useCallback(() => {

@@ -18,2 +18,3 @@ import { useAbortController } from "./hooks/useAbortController.js";

import { returnTrue } from "./referentiallyStable/returnTrue.js";
import { useReferentiallyStableCallback } from "./referentiallyStable/useReferentiallyStableCallback.js";
export {

@@ -36,4 +37,5 @@ emptyArray,

usePreviousValue,
useReferentiallyStableCallback,
useSessionStorageState
};
//# sourceMappingURL=index.js.map

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

/// <reference types="react" />
export declare const useForceRender: () => import("react").DispatchWithoutAction;
//# sourceMappingURL=useForceRender.d.ts.map

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

/// <reference types="react" />
export declare const useIsMounted: () => import("react").MutableRefObject<boolean>;
//# sourceMappingURL=useIsMounted.d.ts.map

@@ -7,2 +7,3 @@ export * from './emptyArray';

export * from './returnTrue';
export * from './useReferentiallyStableCallback';
//# sourceMappingURL=index.d.ts.map
{
"name": "@contember/react-utils",
"license": "Apache-2.0",
"version": "1.1.0",
"version": "1.2.0-alpha.0",
"type": "module",

@@ -31,3 +31,4 @@ "sideEffects": false,

"react": "^17 || ^18"
}
},
"stableVersion": "0.0.0"
}

@@ -9,3 +9,3 @@ import { useCallback, useEffect, useRef } from 'react'

useEffect(() => {
return () => timerRef.current && clearTimeout(timerRef.current)
return () => clearTimeout(timerRef.current)
}, [])

@@ -12,0 +12,0 @@

@@ -7,1 +7,2 @@ export * from './emptyArray'

export * from './returnTrue'
export * from './useReferentiallyStableCallback'

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

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

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