@shopify/react-hooks
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -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; |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18317
33
196
187