mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16: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
20
src/redux/node/constants.ts
Normal file
20
src/redux/node/constants.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { INode } from "../types";
|
||||
|
||||
export const EMPTY_NODE: INode = {
|
||||
id: null,
|
||||
|
||||
user_id: null,
|
||||
|
||||
title: '',
|
||||
files: [],
|
||||
|
||||
cover: null,
|
||||
type: null,
|
||||
|
||||
options: {
|
||||
flow: {
|
||||
display: 'single',
|
||||
show_description: false,
|
||||
}
|
||||
},
|
||||
}
|
3
src/redux/node/handlers.ts
Normal file
3
src/redux/node/handlers.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export const NODE_HANDLERS = {
|
||||
|
||||
};
|
|
@ -1,15 +1,18 @@
|
|||
import { createReducer } from "~/utils/reducer";
|
||||
import { INode } from "../types";
|
||||
import { EMPTY_NODE } from "./constants";
|
||||
import { NODE_HANDLERS } from "./handlers";
|
||||
|
||||
export type INodeState = {
|
||||
export type INodeState = Readonly<{
|
||||
is_loading: boolean;
|
||||
}
|
||||
|
||||
const HANDLERS = {
|
||||
|
||||
};
|
||||
editor: INode;
|
||||
}>;
|
||||
|
||||
const INITIAL_STATE: INodeState = {
|
||||
editor: {
|
||||
...EMPTY_NODE,
|
||||
},
|
||||
is_loading: false,
|
||||
};
|
||||
|
||||
export default createReducer(INITIAL_STATE, HANDLERS);
|
||||
export default createReducer(INITIAL_STATE, NODE_HANDLERS);
|
3
src/redux/node/sagas.ts
Normal file
3
src/redux/node/sagas.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export default function* nodeSaga() {
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue