We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f23837b commit ef14678Copy full SHA for ef14678
DemoApp/Sources/Views/StatsView/DemoStatsAdapter.swift
@@ -29,8 +29,15 @@ final class DemoStatsAdapter {
29
callStatsReportCancellable = call?
30
.state
31
.$statsReport
32
+ .receive(on: DispatchQueue.main)
33
.sink { [weak self] in
- if let report = $0 { self?.reports.append(report) }
34
+ guard let self, let report = $0 else { return }
35
+
36
+ reports.append(report)
37
38
+ if reports.endIndex > 20 {
39
+ _ = reports.dropFirst()
40
+ }
41
}
42
43
0 commit comments