Skip to content

Commit 0cc9c90

Browse files
committed
Update docs on table listener
1 parent 86c4a0b commit 0cc9c90

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

powersync/src/db/watch.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ struct EmitAll {
150150
}
151151

152152
impl TableListenerState {
153-
/// If the dirty flag is set, clears it and returns `true`. Otherwise returns `false`.
153+
/// If there is an outstanding event, consumes and returns it.
154+
///
155+
/// For listeners that emit events when a matched table is updated, the event is always going to
156+
/// be an empty set (which doesn't require an allocation to create). For a listener that matches
157+
/// all tables, we need to emit the actual tables that have been updated in the meantime.
154158
fn take_updates(&self) -> Option<HashSet<String>> {
155159
self.config.take_updates()
156160
}

0 commit comments

Comments
 (0)