Skip to content

Instantly share code, notes, and snippets.

@zapkub
Created November 15, 2018 04:44
Show Gist options
  • Save zapkub/60e9db5e15ad24cc0d15235013d3dcc3 to your computer and use it in GitHub Desktop.
Save zapkub/60e9db5e15ad24cc0d15235013d3dcc3 to your computer and use it in GitHub Desktop.
Todo state
type TodoItem = {
title: string
completed: boolean
}
type TodoState = {
// ชนิดของ filter ที่ toggle อยู่
filter: "All" | "Active" | "Completed",
// Todo ทั้งหมด
todos: Array<TodoItem>,
// เก็บ Input ของช่องสร้าง Todo
textInput: string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment