Skip to content

Instantly share code, notes, and snippets.

View tupton's full-sized avatar

Thomas Upton tupton

View GitHub Profile
@tupton
tupton / z2mtxR24
Created May 24, 2012 00:54 — forked from anonymous/z2mtxR24
a guest on May 23rd, 2012 - pastebin.com/z2mtxR24
if (type == 'node-down' || type == 'cluster-balance') {
this['thresholdNode'].set('disabled', true);
this['comparatorNode'].set('disabled', true);
}
function useTableQuery(queryFn, columnDefs, formatApiData, formatParamsToQueryKey) {
const [queryKey, setQueryKey] = useState('');
const {data, isLoading} = useQuery(queryKey, () => queryFn({ordering: queryKey.sortBy}));
const tableData = useMemo(() => formatApiData(data), [data]);
const columns = useMemo(() => columnDefs, [columnDefs]);
const fetchData = useCallback((params) => {
const paramsToQK = formatParamsToQueryKey(params);