Change debounce return to be optional
This commit is contained in:
parent
830798dc74
commit
ac99c9af4a
|
@ -134,6 +134,9 @@ export function AssetURLsProvider({ children }: { children: React.ReactNode }) {
|
|||
|
||||
// Update the asset keys to load when a url is added without an asset attached
|
||||
useEffect(() => {
|
||||
if (!loadingDebouncedAssetURLs) {
|
||||
return;
|
||||
}
|
||||
let keysToLoad: string[] = [];
|
||||
for (let url of Object.values(loadingDebouncedAssetURLs)) {
|
||||
if (url.url === null) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useState } from "react";
|
||||
|
||||
function useDebounce<Type>(value: Type, delay: number): Type {
|
||||
const [debouncedValue, setDebouncedValue] = useState<Type>(value);
|
||||
function useDebounce<Type>(value: Type, delay: number): Type | undefined {
|
||||
const [debouncedValue, setDebouncedValue] = useState<Type>();
|
||||
|
||||
useEffect(() => {
|
||||
const timeout = setTimeout(() => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user