Add type param to setContext and getContext

pull/5224/head
pngwn 5 years ago
parent a0ed7040f1
commit 86b444bc42

@ -44,11 +44,11 @@ export function createEventDispatcher() {
}; };
} }
export function setContext(key, context) { export function setContext<T>(key, context: T) {
get_current_component().$$.context.set(key, context); get_current_component().$$.context.set(key, context);
} }
export function getContext(key) { export function getContext<T>(key): T {
return get_current_component().$$.context.get(key); return get_current_component().$$.context.get(key);
} }

Loading…
Cancel
Save