mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
## Summary of changes Buckets policies page at /project/_/storage/files/policies now uses the paginated buckets endpoint to fetch buckets. ## Before Used a non-paginated query. ## After To support a paginated query, we now have: - Infinite scroll loading behavior - Fixed some of the buckets utilities to account for policy references to buckets that haven't loaded yet
17 lines
325 B
TypeScript
17 lines
325 B
TypeScript
import { useState } from 'react'
|
|
import { useDebounce } from 'react-use'
|
|
|
|
export const useDebouncedValue = (value: string, delay: number) => {
|
|
const [debouncedValue, setDebouncedValue] = useState(value)
|
|
|
|
useDebounce(
|
|
() => {
|
|
setDebouncedValue(value)
|
|
},
|
|
delay,
|
|
[value]
|
|
)
|
|
|
|
return debouncedValue
|
|
}
|