mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-16 21:43:38 +00:00
Merge pull request #10316 from overleaf/mj-cm6-outline-debouncing
[cm6] Debounce EditorState in CM6 outline GitOrigin-RevId: 759748f1d3dabbe22dc0cd2d3d989c973753442a
This commit is contained in:
parent
665ab24cbd
commit
618d41f623
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,11 @@
|
|||
import { useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {T} value
|
||||
* @param {number} delay
|
||||
* @returns {T}
|
||||
*/
|
||||
export default function useDebounce(value, delay = 0) {
|
||||
const [debouncedValue, setDebouncedValue] = useState(value)
|
||||
|
||||
|
|
Loading…
Reference in a new issue