📜  检测完成写入反应输入 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:23.233000             🧑  作者: Mango

代码示例1
const [typing, settyping] = useState(0);

  const handleChange = () => {
    if (typing) {
      clearTimeout(typing);
    }
    settyping(
      setTimeout(() => {
        console.log('just stopped typing');
      }, 2000)
    );
  };