📜  反应原生自定义去抖动输入 - Javascript 代码示例

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

代码示例1
import React, { useCallback } from "react";
import { debounce } from "lodash";

const handler = useCallback(debounce(someFunction, 2000), []);

const onChange = (event) => {
    // perform any event related action here

    handler();
 };