Skip to content

Commit 4c912c3

Browse files
committed
Changelog
1 parent 38f9225 commit 4c912c3

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

PowerSync/PowerSync.Common/CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
## 0.0.11-alpha.1
44

5+
- Converted most instances of a class inheriting from `EventStream<T>` into a class with an `EventManager` property called `Events`. This allows for subscribing to individual events instead of subscribing to all events and then filtering events manually.
6+
7+
```csharp
8+
// Old
9+
var listener = db.Listen(cts.Token);
10+
foreach (PowerSyncDBEvent update in listener)
11+
{
12+
// Manually filter updates
13+
if (update.StatusChanged != null)
14+
{
15+
Console.WriteLine("status changed: " + update.StatusChanged!);
16+
}
17+
}
18+
19+
// New
20+
var listener = db.Events.OnStatusChanged.Listen(cts.Token);
21+
foreach (PowerSyncDBEvents.StatusChangedEvent update in listener)
22+
{
23+
// Events are filtered inherently
24+
Console.WriteLine("status changed: " + update.Status);
25+
}
26+
```
27+
528
- Updated to the latest version (0.4.11) of the core extension.
629
- `MDSQLiteConnection` now runs query operations on another thread, which stops the caller thread from blocking.
730
- Removed the `RunListener` and `RunListenerAsync` APIs from `IEventStream`. Users are encouraged to use the `Listen` or `ListenAsync` APIs instead (`RunListener` itself was implemented using the `Listen` API).

0 commit comments

Comments
 (0)