* Reset the client to its default state (i.e. stop PubSub, stop monitoring, select default DB, etc.)
()
| 1754 | * Reset the client to its default state (i.e. stop PubSub, stop monitoring, select default DB, etc.) |
| 1755 | */ |
| 1756 | async reset() { |
| 1757 | const chainId = Symbol('Reset Chain'), |
| 1758 | promises = [this._self.#queue.reset(chainId)], |
| 1759 | selectedDB = this._self.#options?.database ?? 0; |
| 1760 | this._self.#credentialsSubscription?.dispose(); |
| 1761 | this._self.#credentialsSubscription = null; |
| 1762 | promises.push(...(await this._self.#handshake(chainId, false))); |
| 1763 | this._self.#scheduleWrite(); |
| 1764 | await Promise.all(promises); |
| 1765 | this._self.#selectedDB = selectedDB; |
| 1766 | this._self.#monitorCallback = undefined; |
| 1767 | this._self.#dirtyWatch = undefined; |
| 1768 | this._self.#watchEpoch = undefined; |
| 1769 | } |
| 1770 | |
| 1771 | /** |
| 1772 | * If the client has state, reset it. |
no test coverage detected