mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 03:11:12 +01:00
JSONPath filter plugins working
This commit is contained in:
7
src-web/hooks/useToggle.ts
Normal file
7
src-web/hooks/useToggle.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
export function useToggle(initialValue = false) {
|
||||
const [value, setValue] = useState<boolean>(initialValue);
|
||||
const toggle = useCallback(() => setValue((v) => !v), []);
|
||||
return [value, toggle] as const;
|
||||
}
|
||||
Reference in New Issue
Block a user