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

Method update

extensions/amp-access-scroll/0.1/scroll-sheet.js:29–55  ·  view source on GitHub ↗

* @param {!JsonObject} action

(action)

Source from the content-addressed store, hash-verified

27 * @param {!JsonObject} action
28 */
29 update(action) {
30 let changed = false;
31
32 switch (action['_scramp']) {
33 case 'au':
34 changed = this.updateHorizontalLayout(action);
35 ['open', 'url', 'title'].forEach((key) => {
36 if (hasOwn(action, key) && action[key] !== this.state_[key]) {
37 this.state_[key] = action[key];
38 changed = true;
39 }
40 });
41 break;
42 case 'st':
43 ['revealed'].forEach((key) => {
44 if (hasOwn(action, key) && action[key] !== this.state_[key]) {
45 this.state_[key] = action[key];
46 changed = true;
47 }
48 });
49 break;
50 }
51
52 if (changed) {
53 this.render_(this.state_);
54 }
55 }
56
57 /**
58 * @param {!Sheet.State} state

Callers 5

authorizeMethod · 0.95
test-component.jsFile · 0.45
selectDateFunction · 0.45
test-component.jsFile · 0.45
vue-todomvc.jsFile · 0.45

Calls 4

render_Method · 0.95
hasOwnFunction · 0.90
forEachMethod · 0.45

Tested by

no test coverage detected