
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
use-consistent-value
Advanced tools
Keep a consistent reference to an object or array based on their values
Keep a consistent reference to an object or array based on their values. Useful when using them as dependencies of an useEffect, useMemo or useCallback hooks.
Install it
$ yarn add use-consistent-value
Import it
import useConsistentValue from 'use-consistent-value';
Use it inside a component
const [title, setState] = React.useState('');
const consistentValue = useConsistentValue({ title });
React.useEffect(() => {
// do something with consistentValue
}, [consistentValue]);
By default, useConsistentValue
uses fast-deep-equal
to compare the stored value and the new value, this could be configured passing a compare
function as second argument of the hook, useful when you want to check a less properties to know if it changed.
const consistentValue = useConsistentValue(
{ title, ignoredOnCompare },
(a, b) => a.title === b.title
);
The compare
function must return a boolean, with true
in case the values are the same and false
if they are not.
FAQs
Keep a consistent reference to an object or array based on their values
The npm package use-consistent-value receives a total of 4,197 weekly downloads. As such, use-consistent-value popularity was classified as popular.
We found that use-consistent-value demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.