fix timeouts

pull/5370/head
filip mertens 3 years ago
parent 9c57c6bca9
commit 2676795e48
  1. 5
      libs/remix-ui/search/src/lib/components/Exclude.tsx
  2. 5
      libs/remix-ui/search/src/lib/components/Include.tsx
  3. 5
      libs/remix-ui/search/src/lib/components/Replace.tsx

@ -4,10 +4,11 @@ import { SearchContext } from '../context/context'
export const Exclude = props => {
const { setExclude, state } = useContext(SearchContext)
const [str, setStr] = useState<string>('.git/**/*,.deps/**/*')
let timeOutId: any = null
const change = e => {
setStr(e.target.value)
const timeOutId = setTimeout(() => setExclude(e.target.value), 500)
return () => clearTimeout(timeOutId)
clearTimeout(timeOutId)
timeOutId = setTimeout(() => setExclude(e.target.value), 500)
}
useEffect(() => {

@ -3,9 +3,10 @@ import { SearchContext } from '../context/context'
export const Include = props => {
const { setInclude } = useContext(SearchContext)
let timeOutId: any = null
const change = e => {
const timeOutId = setTimeout(() => setInclude(e.target.value), 500)
return () => clearTimeout(timeOutId)
clearTimeout(timeOutId)
timeOutId = setTimeout(() => setInclude(e.target.value), 500)
}
return (

@ -3,9 +3,10 @@ import { SearchContext } from '../context/context'
export const Replace = props => {
const { setReplace } = useContext(SearchContext)
let timeOutId: any = null
const change = e => {
const timeOutId = setTimeout(() => setReplace(e.target.value), 500)
return () => clearTimeout(timeOutId)
clearTimeout(timeOutId)
timeOutId = setTimeout(() => setReplace(e.target.value), 500)
}
return (

Loading…
Cancel
Save