@sigi/ssr
Version:
Server side rendering support for sigi framework
13 lines • 610 B
JavaScript
import { GLOBAL_KEY_SYMBOL, RETRY_KEY_SYMBOL } from '@sigi/core';
export function restoreState() {
var _a, _b;
var sigiStateContent = (_a = document.getElementById(GLOBAL_KEY_SYMBOL)) === null || _a === void 0 ? void 0 : _a.textContent;
var sigiRetryContent = (_b = document.getElementById(RETRY_KEY_SYMBOL)) === null || _b === void 0 ? void 0 : _b.textContent;
if (sigiStateContent) {
window[GLOBAL_KEY_SYMBOL] = JSON.parse(sigiStateContent);
}
if (sigiRetryContent) {
window[RETRY_KEY_SYMBOL] = JSON.parse(sigiRetryContent);
}
}
//# sourceMappingURL=browser.js.map