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
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,33 @@
1
1
# PowerSync.Common Changelog
2
2
3
+
## 0.0.11-alpha.1
4
+
5
+
- 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.
6
+
7
+
```csharp
8
+
// Optional cancellation token
9
+
varcts=newCancellationTokenSource();
10
+
11
+
// Register listener synchronously on the calling thread...
12
+
varlistener=db.Watch<Todo>(
13
+
"SELECT * FROM todos",
14
+
[],
15
+
newSQLWatchOptions { Signal=cts.Token }
16
+
);
17
+
18
+
// ...then listen to changes on another thread
19
+
_=Task.Run(async () =>
20
+
{
21
+
awaitforeach (varresultinlistener)
22
+
{
23
+
Console.WriteLine($"Number of todos: {result.Length}");
24
+
}
25
+
}, cts.Token);
26
+
27
+
// Stop watching by cancelling token
28
+
cts.Cancel();
29
+
```
30
+
3
31
## 0.0.10-alpha.1
4
32
5
33
- Fixed watched queries sometimes resolving to the wrong underlying tables after a schema change.
0 commit comments