* Destroys the given `Query` and removes it from the cache, notifying subscribers with a * `'removed'` event. A no-op if the query is no longer the one currently stored under its hash * (e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror * removals across
(query: Query<any, any, any, any>)
| 233 | * ``` |
| 234 | */ |
| 235 | remove(query: Query<any, any, any, any>): void { |
| 236 | const queryInMap = this.#queries.get(query.queryHash) |
| 237 | |
| 238 | if (queryInMap === query) { |
| 239 | query.destroy() |
| 240 | this.#queries.delete(query.queryHash) |
| 241 | this.notify({ type: 'removed', query }) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Removes all queries from the cache. |
no test coverage detected