Commit 9b09ff9
committed
refactor: use ??= to make stream subscriptions idempotent
Per Copilot review feedback, use ??= instead of cancel-and-reassign
to ensure subscriptions are only created once even if initialize()
is called multiple times. This is cleaner and avoids unnecessary
cancellation of active subscriptions.1 parent d4fb534 commit 9b09ff9
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
76 | | - | |
77 | | - | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
137 | | - | |
| 135 | + | |
0 commit comments