From 881a0ca94de15af1a9fd77778d6305bc6545a65f Mon Sep 17 00:00:00 2001 From: pushkin Date: Wed, 18 Nov 2020 13:44:00 +0100 Subject: [PATCH] Update lifecycle.ts --- src/runtime/internal/lifecycle.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts index 4a7616bdea..002bd78d24 100644 --- a/src/runtime/internal/lifecycle.ts +++ b/src/runtime/internal/lifecycle.ts @@ -54,6 +54,10 @@ export function getContext(key): T { return get_current_component().$$.context.get(key); } +export function hasContext(key): boolean { + return get_current_component().$$.context.has(key); +} + // TODO figure out if we still want to support // shorthand events, or if we want to implement // a real bubbling mechanism