* Sanitizes a state object and merges the resulting object into the current * state. * @param {!JsonObject} state * @return {!Promise}
(state)
| 336 | * @return {!Promise} |
| 337 | */ |
| 338 | setStateWithObject(state) { |
| 339 | // Sanitize and copy state |
| 340 | const result = this.copyJsonObject_(state); |
| 341 | if (!result) { |
| 342 | return Promise.reject('Invalid state'); |
| 343 | } |
| 344 | return this.setStateAndUpdateHistory_(result); |
| 345 | } |
| 346 | |
| 347 | /** |
| 348 | * Merges a state object into the current global state. |
no test coverage detected