摘要: 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(9) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(7) 评论(0) 推荐(0)
摘要: 在本节中我们使用到了 8 种类型: number, string, boolean, 函数,array, any, void, object 这一节我们接触到了平常使用中会接触到的大部分的类型,下面我们挨个梳理一遍: number:数字类型,包含小数、其他进制的数字 let decimal: num 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(33) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(12) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(13) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(10) 评论(0) 推荐(0)
摘要: export const useDebounce = <V>(value: V, delay?: number) => { const [debouncedValue, setDebouncedValue] = useState(value); useEffect(() => { // 每次在val 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(16) 评论(0) 推荐(0)
摘要: // const debounce = (func, delay) => { // let timeout; // return (...param) => { // if (timeout) { // clearTimeout(timeout); // } // timeout = setTime 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(29) 评论(0) 推荐(0)
摘要: 自定义hook export const useMount = (callback: () => void) => { useEffect(() => { callback(); }, [callback]); }; 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(8) 评论(0) 推荐(0)
摘要: export const isVoid = (value: unknown) => value undefined || value null || value ""; // let a: object // a = {name: 'jack'} // a = () => { // } // a = 阅读全文
posted @ 2022-10-07 18:44 前端导师歌谣 阅读(15) 评论(0) 推荐(0)