mirror of
https://github.com/enso-org/enso.git
synced 2024-12-21 03:41:47 +03:00
f2651d58e4
- Closes #7916 # Important Notes None
23 lines
589 B
TypeScript
23 lines
589 B
TypeScript
// @ts-nocheck
|
|
import { getCurrentInstance, ref, type App } from 'vue'
|
|
|
|
export const isDark = ref(false)
|
|
|
|
if (!window.__hst_controls_dark) {
|
|
// eslint-disable-next-line camelcase
|
|
window.__hst_controls_dark = []
|
|
}
|
|
|
|
// There could be multiple instances of the controls lib (in the controls book https://controls.histoire.dev)
|
|
window.__hst_controls_dark.push(isDark)
|
|
|
|
window.__hst_controls_dark_ready?.()
|
|
|
|
export function createSetupComponent(setup: (app: App) => void) {
|
|
return () => {
|
|
const app = getCurrentInstance()?.appContext.app
|
|
if (app) setup(app)
|
|
return null
|
|
}
|
|
}
|