* Merges a state object into the current global state. * @param {!JsonObject} state * @return {!Promise} * @private
(state)
| 351 | * @private |
| 352 | */ |
| 353 | setStateAndUpdateHistory_(state) { |
| 354 | dev().info(TAG, 'setState:', state); |
| 355 | this.setStatePromise_ = this.setState(state) |
| 356 | .then(() => this.getDataForHistory_()) |
| 357 | .then((data) => { |
| 358 | // Don't bother calling History.replace with empty data. |
| 359 | if (data) { |
| 360 | this.history_.replace(data); |
| 361 | } |
| 362 | }); |
| 363 | return this.setStatePromise_; |
| 364 | } |
| 365 | |
| 366 | /** |
| 367 | * Same as setStateWithExpression() except also pushes new history. |