@dark-engine/core
Version:
The lightweight and powerful UI rendering engine without dependencies and written in TypeScript (Browser, Node.js, Android, iOS, Windows, Linux, macOS)
25 lines (24 loc) • 956 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
exports.detectIsSSR = exports.detectIsHydration = exports.detectIsServer = exports.platform = void 0;
const utils_1 = require('../utils');
const scope_1 = require('../scope');
const realisation = () => (0, utils_1.illegal)('The function was not installed by renderer!');
const platform = {
createElement: realisation,
toggle: realisation,
raf: realisation,
caf: realisation,
spawn: realisation,
commit: realisation,
finishCommit: realisation,
detectIsDynamic: realisation,
};
exports.platform = platform;
const detectIsServer = () => !platform.detectIsDynamic();
exports.detectIsServer = detectIsServer;
const detectIsHydration = () => (0, scope_1.$$scope)().getIsHydration();
exports.detectIsHydration = detectIsHydration;
const detectIsSSR = () => detectIsServer() || detectIsHydration();
exports.detectIsSSR = detectIsSSR;
//# sourceMappingURL=platform.js.map