mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-12-02 16:49:06 +00:00
Add fuzzy search (#511)
* Add fuzzy search * Improve search performance
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { DependencyList, EffectCallback, useEffect, useRef } from 'react';
|
||||
|
||||
export const useUpdateEffect = (effect: EffectCallback, deps?: DependencyList) => {
|
||||
const isFirstRef = useRef(true);
|
||||
|
||||
if (isFirstRef.current) {
|
||||
isFirstRef.current = false;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!isFirstRef.current) {
|
||||
return effect();
|
||||
}
|
||||
}, deps);
|
||||
};
|
||||
Reference in New Issue
Block a user