MCPcopy Create free account
hub / github.com/ampproject/amphtml / setStateWithObject

Method setStateWithObject

extensions/amp-bind/0.1/bind-impl.js:338–345  ·  view source on GitHub ↗

* Sanitizes a state object and merges the resulting object into the current * state. * @param {!JsonObject} state * @return {!Promise}

(state)

Source from the content-addressed store, hash-verified

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.

Callers 2

attachShadowDoc_Method · 0.80

Calls 2

copyJsonObject_Method · 0.95

Tested by

no test coverage detected