chore: abort on state change

This commit is contained in:
skinmaker1345 2024-03-04 23:43:54 +09:00
parent f9289dd6c7
commit 8f4b431ee3

View File

@ -61,6 +61,12 @@ const Search: React.FC = () => {
}, 1000)
return () => {
clearTimeout(timeout)
try {
abortController.current?.abort()
abortController.current = null
} catch (e) {
return null
}
}
}, [query])