From d893046830b906fa90ed1474a173b496d79707b7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 3 Oct 2018 13:03:20 -0400 Subject: [PATCH] wip: warning --- packages/core/src/warning.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/core/src/warning.ts 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 +}