Add type param to setContext and getContext (#5224)

pull/5243/head
pngwn 4 years ago committed by GitHub
parent 231e4a0b3c
commit d81cb83ae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
}
export function getContext(key) {
export function getContext<T>(key): T {
return get_current_component().$$.context.get(key);
}

Loading…
Cancel
Save