news
Task 3: localStorage Persistence
Add persistence layer for todos. **Do:** - Create `src/lib/storage.ts` - Implement `loadTodos(): Todo[]` and `saveTodos(todos: Todo[])` - Handle JSON parse errors gracefully (return empty array) - Integrate with store: load on init, save on change - Add tests for load/save/error handling **Verify:** - Tests pass - Manual test: add todo, refresh page, todo persists ---
← 返回教程列表
AI8899 · 内容仅供学习参考