Skip to content

Instantly share code, notes, and snippets.

@dht
dht / types.play.ts
Created January 31, 2021 20:38
redux store generator
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;
@dht
dht / types.ts
Last active January 31, 2021 20:37
types
// ============== 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 };