MCPcopy
hub / github.com/ampproject/amphtml / getStore_

Method getStore_

src/service/storage-impl.js:121–133  ·  view source on GitHub ↗

* @return {!Promise<!Store>} * @private

()

Source from the content-addressed store, hash-verified

119 * @private
120 */
121 getStore_() {
122 if (!this.storePromise_) {
123 this.storePromise_ = this.binding_
124 .loadBlob(this.origin_)
125 .then((blob) => (blob ? parseJson(atob(blob)) : {}))
126 .catch((reason) => {
127 dev().expectedError(TAG, 'Failed to load store: ', reason);
128 return {};
129 })
130 .then((obj) => new Store(obj));
131 }
132 return this.storePromise_;
133 }
134
135 /**
136 * @param {function(!Store)} mutator

Callers 2

getMethod · 0.95
saveStore_Method · 0.95

Calls 6

parseJsonFunction · 0.90
devFunction · 0.90
catchMethod · 0.80
thenMethod · 0.45
loadBlobMethod · 0.45
expectedErrorMethod · 0.45

Tested by

no test coverage detected