* 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>)
| 206 | * ``` |
| 207 | */ |
| 208 | remove(query: Query<any, any, any, any>): void { |
| 209 | const queryInMap = this.#queries.get(query.queryHash) |
| 210 | |
| 211 | if (queryInMap === query) { |
| 212 | query.destroy() |
| 213 | this.#queries.delete(query.queryHash) |
| 214 | this.notify({ type: 'removed', query }) |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Removes all queries from the cache. |
no test coverage detected