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:
parent
26e6d8d41b
commit
a4bb07e9cf
323 changed files with 2464 additions and 3348 deletions
|
@ -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];
|
||||
};
|
||||
|
|
|
@ -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);
|
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue