Types.ts

 avatar
unknown
typescript
5 months ago
365 B
2
Indexable
import { empty, Repo } from "../lib/repo";

export type State = {
  readonly todos: Repo<Todo>;
  readonly filter: TodoFilter;
};

export type Todo = {
  readonly id: string;
  readonly title: string;
  readonly done: boolean;
};

export type TodoFilter = "all" | "done" | "active";

export const initialState: State = {
  todos: empty<Todo>(),
  filter: "all",
};
Editor is loading...
Leave a Comment