@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)
19 lines (18 loc) • 666 B
JavaScript
import { illegal } from '../utils';
import { $$scope } from '../scope';
const realisation = () => 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,
};
const detectIsServer = () => !platform.detectIsDynamic();
const detectIsHydration = () => $$scope().getIsHydration();
const detectIsSSR = () => detectIsServer() || detectIsHydration();
export { platform, detectIsServer, detectIsHydration, detectIsSSR };
//# sourceMappingURL=platform.js.map