03 2023 档案
react useCreateWatchedStore 轻量级高性能状态管理库
摘要:import {useContext, useEffect, useMemo, useRef, useState} from 'react'; import _get from "lodash.get"; import _set from "lodash.set"; import {shallowE 阅读全文
posted @ 2023-03-31 14:41 袜子破了 阅读(25) 评论(0) 推荐(0)
react useEnhancedState
摘要:import {useCallback, useRef, useState} from 'react'; import {shallowEqual} from "../utils/shallowEqual"; function isEquals(compare: any, current: any, 阅读全文
posted @ 2023-03-30 22:06 袜子破了 阅读(20) 评论(0) 推荐(0)
react useComparedState
摘要:import {useCallback, useRef, useState} from 'react'; import {shallowEqual} from "../utils/shallowEqual"; function useComparedState(initialState: any) 阅读全文
posted @ 2023-03-30 22:03 袜子破了 阅读(20) 评论(0) 推荐(0)
react usePersistFn
摘要:import {useRef,} from 'react'; function usePersistFn(fn) { const fnRef = useRef(fn); fnRef.current = fn; const persistFn = useRef(); if (!persistFn.cu 阅读全文
posted @ 2023-03-22 17:02 袜子破了 阅读(93) 评论(0) 推荐(0)
react useCurrentState
摘要:import {useCallback, useRef, useState} from 'react'; function useCurrentState(initialState: any, compare?: any) { const [state, setState] = useState(i 阅读全文
posted @ 2023-03-01 22:30 袜子破了 阅读(30) 评论(0) 推荐(0)