New
Added three new methods to `StateDict[K, V]`:
- `.additions() -> AsyncIterator[tuple[K, V]]`: Yields `(key, value)` once a new key is set in state dict (in the future).
- `.deletions() -> AsyncIterator[tuple[K, V]] `: Like `additions()`, but for deleted keys.
- `.changes() -> AsyncIterator[tuple[K, V, V]]`: Yields `(key, value_old, value_new)` once an existing key is set to a new value.
If the async iterable constructor argument of a `StateDict[K, V]` can now yield `(K, ...)` (in contrast to `(K, V)`) to delete the state dict entry with the key (not documented yet).
Removed
- `StateDict.head`: The new methods are more flexible and robust
Fixed
- Async iteration of a `State` instance now internally uses a lightweight queue of futures, to ensure that all changes are iterated (even if it's iterated over slower than it changes).