* Commits data to the session store * * @example * await client.commit() // Saves all changes to the store
()
| 91 | * await client.commit() // Saves all changes to the store |
| 92 | */ |
| 93 | async commit() { |
| 94 | if (!this.#flashMessagesStore.isEmpty) { |
| 95 | this.#valuesStore.set(this.flashKey, this.#flashMessagesStore.toJSON()) |
| 96 | } |
| 97 | |
| 98 | debug('committing session data during api request') |
| 99 | if (!this.#valuesStore.isEmpty) { |
| 100 | this.#store.write(this.sessionId, this.#valuesStore.toJSON()) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Destroys the session data from the store |