Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@crumb/use-debounce
Advanced tools
React hook to debounce state updates.
This package is a custom React hook that can be used for debouncing state updates. This is useful when state changes cause large re-renders such as a search box for a long list of items.
Other similar packages exist for debouncing values, such as Nik Mostovoy's use-debounce package, but this package aims to be a very lightweight plugin to easily get up and running without adding lots of extra code bloat.
# Yarn
yarn add @crumb/use-debounce
# npm
npm install @crumb/use-debounce
The following is a simple usage showing how the debounced value will be different from the actual value. In an actual application, you will likely use the debounced value in a useMemo
hook or as a prop to a memoized component.
import React, { useState } from 'react'
import { useDebounce } from '@crumb/use-debounce'
function Input() {
const [text, setText] = useState('Hello')
const value = useDebounce(text, 1000)
return (
<div>
<input
defaultValue="Hello"
onChange={event => setText(event.target.value)}
/>
<p>Actual value: {text}</p>
<p>Debounce value: {value}</p>
</div>
)
}
FAQs
React hook to debounce state updates.
The npm package @crumb/use-debounce receives a total of 0 weekly downloads. As such, @crumb/use-debounce popularity was classified as not popular.
We found that @crumb/use-debounce 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.