Skip to content

Commit c2e6c86

Browse files
committed
Warn against the independent observation of each element in a list.
1 parent 7c2cbfe commit c2e6c86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

GRDB/Documentation.docc/Extension/ValueObservation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ You can filter out undesired duplicate notifications with the ``removeDuplicates
263263

264264
When needed, you can help GRDB optimize observations and reduce database contention:
265265

266+
> Important: **Keep your number of observations bounded.**
267+
>
268+
> In particular, do not observe independently all elements in a list. Instead, observe the whole list in a single observation.
269+
266270
> Tip: Stop observations when possible.
267271
>
268272
> For example, if a `UIViewController` needs to display database values, it can start the observation in `viewWillAppear`, and stop it in `viewWillDisappear`.

0 commit comments

Comments
 (0)