1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

removed redux completely

This commit is contained in:
Fedor Katurov 2022-01-09 19:03:01 +07:00
parent 26e6d8d41b
commit a4bb07e9cf
323 changed files with 2464 additions and 3348 deletions

View file

@ -7,13 +7,13 @@ export const usePersistedState = (key: string, initial: string): [string, (val:
} catch (e) {
return initial;
}
}, [key]);
}, [key, initial]);
const [val, setVal] = useState<string>(stored);
useEffect(() => {
localStorage.setItem(`vault_${key}`, val);
}, [val]);
}, [val, key]);
return [val, setVal];
};

View file

@ -1,5 +0,0 @@
import { shallowEqual, useSelector } from 'react-redux';
import { IState } from '~/redux/store';
export const useShallowSelect = <T extends (state: IState) => any>(selector: T): ReturnType<T> =>
useSelector(selector, shallowEqual);

View file

@ -1,5 +1,5 @@
import { UploadSubject, UploadTarget } from '~/constants/uploads';
import { IFile } from '~/redux/types';
import { IFile } from '~/types';
import { useCallback } from 'react';
import { apiUploadFile } from '~/api/uploads';
import { keys } from 'ramda';