diff --git a/packages/core/src/warning.ts b/packages/core/src/warning.ts new file mode 100644 index 00000000..80f9ad31 --- /dev/null +++ b/packages/core/src/warning.ts @@ -0,0 +1,20 @@ +import { MountedComponent, ComponentType } from './component' + +let currentComponent: MountedComponent | null = null +let currentComponentDefinition: ComponentType | null = null + +export function setCurrentComponent(c: MountedComponent) { + currentComponent = c +} + +export function unsetCurrentComponent() { + currentComponent = null +} + +export function setCurrentComponentDefinition(d: ComponentType) { + currentComponentDefinition = d +} + +export function unsetCurrentComponentDefinition() { + currentComponentDefinition = null +}