* Increment the active subscribers count and start sync if needed
()
| 180 | * Increment the active subscribers count and start sync if needed |
| 181 | */ |
| 182 | private addSubscriber(): void { |
| 183 | const previousSubscriberCount = this.activeSubscribersCount |
| 184 | this.activeSubscribersCount++ |
| 185 | this.lifecycle.cancelGCTimer() |
| 186 | |
| 187 | // Start sync if collection was cleaned up |
| 188 | if ( |
| 189 | this.lifecycle.status === `cleaned-up` || |
| 190 | this.lifecycle.status === `idle` |
| 191 | ) { |
| 192 | this.sync.startSync() |
| 193 | } |
| 194 | |
| 195 | this.events.emitSubscribersChange( |
| 196 | this.activeSubscribersCount, |
| 197 | previousSubscriberCount, |
| 198 | ) |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Decrement the active subscribers count and start GC timer if needed |
no test coverage detected