This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useMemo } from "react"; | |
import { debounce } from "lodash"; | |
export function useDebounceCallback(callback: (...values: any[]) => void, delay: number) { | |
// eslint-disable-next-line react-hooks/exhaustive-deps | |
const onChangeDebounce = useMemo(() => debounce(callback, delay), []); | |
useEffect(() => { | |
return () => onChangeDebounce.cancel(); | |
// eslint-disable-next-line react-hooks/exhaustive-deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SpecificParams<T extends Record<string, string>> { | |
key: keyof T; | |
value: string; | |
} | |
interface GenericParams { | |
key: string; | |
value: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { queryParamsFactory } from "../utils/functions/queryParams"; | |
describe("Testing queryParamsFactory functionalities", () => { | |
test(`add param`, () => { | |
const queryParamUrlWithAddedParam = queryParamsFactory<{ | |
testKey1: string; | |
testKey2: string; | |
}>("?testKey1=testValue1&testKey2=testValue2").addParam({ | |
key: "testKey3", | |
value: "addedValue3", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.editor.wrapTabs": true, | |
"workbench.editor.decorations.colors": true, | |
"workbench.editor.decorations.badges": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.editor.decorations.badges": true, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.editor.wrapTabs": true, | |
"workbench.editor.decorations.colors": true, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.editor.decorations.colors": true, | |
} |