We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am wondering if it's possible to annotate setContext calls such that the exposed variables are typed.
setContext
For example:
<!-- MyLogger.svelte --> <script context="module"> import { setContext } from 'svelte'; /** * Log something * @type {(message: string) => void} */ function log(message) { console.log(message); } setContext('my-logger', log); </script>
My problem is that even though log has type annotations, when someone gets the function via getContext('my-logger') the type is unknown.
log
getContext('my-logger')
I wonder if there's a way to add type annotations to setContext.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am wondering if it's possible to annotate
setContext
calls such that the exposed variables are typed.For example:
My problem is that even though
log
has type annotations, when someone gets the function viagetContext('my-logger')
the type is unknown.I wonder if there's a way to add type annotations to
setContext
.The text was updated successfully, but these errors were encountered: