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

@shopify/react-hooks

Package Overview
Dependencies
Maintainers
13
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-hooks - npm Package Compare versions

Comparing version 1.6.1 to 1.7.0

dist/src/hooks/debounced.d.ts

6

CHANGELOG.md

@@ -8,4 +8,8 @@ # Changelog

<!-- ## [Unreleased] -->
## [Unreleased]
### Added
- Added `useDebouncedValue` hook ([#1354](https://github.com/Shopify/quilt/pull/1354))
## [1.6.1] - 2020-04-07

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

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

export { useDebouncedValue } from './debounced';
export { useInterval } from './interval';

@@ -2,0 +3,0 @@ export { useLazyRef } from './lazy-ref';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var debounced_1 = require("./debounced");
exports.useDebouncedValue = debounced_1.useDebouncedValue;
var interval_1 = require("./interval");

@@ -4,0 +6,0 @@ exports.useInterval = interval_1.useInterval;

2

package.json
{
"name": "@shopify/react-hooks",
"version": "1.6.1",
"version": "1.7.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "A collection of primitive React hooks.",

@@ -16,2 +16,23 @@ # `@shopify/react-hooks`

### `useDebouncedValue()`
This hook provide a debounced value.
```tsx
function MyComponent() {
const [searchValue, setSearchValue] = useState('');
const debouncedSearch = useDebouncedValue(searchValue);
const {data, loading} = useQuery(SomeQuery, {
variables: {
query: debouncedSearch,
},
});
function handleSearchTextChange(evt: React.KeyboardEvent) {
setSearchValue(evt.currentTarget.value);
}
return (<input onChange={handleSearchTextChange} />);
```
### `useOnValueChange()`

@@ -18,0 +39,0 @@

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