docs(plan): store v2

This commit is contained in:
Rahim
2026-01-31 18:43:38 +11:00
parent d081db9507
commit 8d849f9af7
2 changed files with 1292 additions and 44 deletions
@@ -1,44 +0,0 @@
# Queue Simplification
**Status:** COMPLETED
## Summary
Simplified Queue from ~524 LOC to ~405 LOC. Removed convenience features only used in tests/docs, kept essentials for async media operations.
## Why Queue Exists
All writes are async requests. Queue handles:
- Supersession (rapid clicks → only last executes)
- AbortController propagation
- Task lifecycle tracking (pending/success/error)
- Error surfacing for UI
## Removed
- `cancel()`, `flush()`, `queued` getter
- `TaskScheduler`, `QueueConfig`, `schedule` param
- `delay()`, `microtask`, DOM schedulers (`raf()`, `idle()`)
- `onDispatch`, `onSettled` hooks
## Final API
```ts
interface Queue<Tasks> {
readonly tasks: TasksRecord<Tasks>;
readonly destroyed: boolean;
enqueue<K>(task: QueueTask<K>): Promise<Tasks[K]['output']>;
abort(name?: keyof Tasks): void;
reset(name?: keyof Tasks): void;
destroy(): void;
subscribe(callback: StateChange<TasksRecord<Tasks>>): () => void;
}
```
## Bundle Size
| Scenario | Gzipped |
| ----------------------------------- | ------- |
| Minimal (createStore + createSlice) | 2.3 KB |
| Full entry (all exports) | 3.0 KB |
File diff suppressed because it is too large Load Diff