mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
node and upload reducer
This commit is contained in:
parent
e0bba90d2e
commit
5045fbce8b
11 changed files with 87 additions and 19 deletions
3
src/redux/uploads/handlers.ts
Normal file
3
src/redux/uploads/handlers.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export const UPLOAD_HANDLERS = {
|
||||
|
||||
}
|
20
src/redux/uploads/reducer.ts
Normal file
20
src/redux/uploads/reducer.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { createReducer } from "~/utils/reducer";
|
||||
import { IFile } from "~/constants/cells";
|
||||
import { UUID } from "../types";
|
||||
import { UPLOAD_HANDLERS } from "./handlers";
|
||||
|
||||
export interface IUploadStatus {
|
||||
progress: number; is_loading: boolean; error: string;
|
||||
}
|
||||
|
||||
export interface IUploadState {
|
||||
files: Record<UUID, IFile>;
|
||||
statuses: Record<UUID, IUploadStatus>;
|
||||
}
|
||||
|
||||
const INITIAL_STATE = {
|
||||
files: {},
|
||||
statuses: {},
|
||||
};
|
||||
|
||||
export default createReducer(INITIAL_STATE, UPLOAD_HANDLERS);
|
3
src/redux/uploads/sagas.ts
Normal file
3
src/redux/uploads/sagas.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export default function* () {
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue