1
0
Fork 0
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:
muerwre 2019-08-06 18:32:51 +07:00
parent e0bba90d2e
commit 5045fbce8b
11 changed files with 87 additions and 19 deletions

View 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,
}
},
}

View file

@ -0,0 +1,3 @@
export const NODE_HANDLERS = {
};

View file

@ -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
View file

@ -0,0 +1,3 @@
export default function* nodeSaga() {
}