You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PowerSync/PowerSync.Common/CHANGELOG.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,34 @@
1
1
# PowerSync.Common Changelog
2
2
3
+
## 0.0.11-alpha.1
4
+
5
+
- 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).
6
+
- Changed the `PowerSyncDatabase.Watch` syntax to return an IAsyncEnumerable instead of accepting a callback. This allows users to handle database changes when they are ready instead of us eagerly running the callback as soon as a change is detected.
7
+
8
+
```csharp
9
+
// Optional cancellation token
10
+
varcts=newCancellationTokenSource();
11
+
12
+
// Register listener synchronously on the calling thread...
13
+
varlistener=db.Watch<Todo>(
14
+
"SELECT * FROM todos",
15
+
[],
16
+
newSQLWatchOptions { Signal=cts.Token }
17
+
);
18
+
19
+
// ...then listen to changes on another thread
20
+
_=Task.Run(async () =>
21
+
{
22
+
awaitforeach (varresultinlistener)
23
+
{
24
+
Console.WriteLine($"Number of todos: {result.Length}");
25
+
}
26
+
}, cts.Token);
27
+
28
+
// Stop watching by cancelling token
29
+
cts.Cancel();
30
+
```
31
+
3
32
## 0.0.10-alpha.1
4
33
5
34
- Fixed watched queries sometimes resolving to the wrong underlying tables after a schema change.
0 commit comments