Skip to content

Instantly share code, notes, and snippets.

@dht
dht / types.play.ts
Created Jan 31, 2021
redux store generator
View types.play.ts
import { StoreStructure, Actions } from './types';
type AppState = { isLoading: boolean; email?: string };
type Task = { id: string; title: string };
type Tasks = Record<string, Task>;
type Log = { id: string };
type Logs = Array<Log>;
interface MyStore extends StoreStructure {
appState: AppState;
View types.ts
// ============== store ==============
export enum NodeTypes {
SINGLE_NODE = 'SINGLE_NODE',
COLLECTION_NODE = 'COLLECTION_NODE',
QUEUE_NODE = 'QUEUE_NODE',
}
export type Value = number | boolean | string | null | undefined;
export type Item = { [fieldName: string]: Value } & { id: string };