mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
docs(plan): store v2
This commit is contained in:
@@ -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
Reference in New Issue
Block a user