Skip to content
New issue

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

feat: provide ContextKey type for better typing of setContext/getContext #11042

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 3, 2024

  1. feat: provide ContextKey type for better typing of `setContext/getCon…

    …text`
    
    Not completly ideal because you can circumvent the type safety by doing `getContext<SomeType>(context_key)` - changing this would require a breaking change, which we could do in Svelte 6 after we've given `ContextKey` some time to establish itself.
    Also doesn't add the interesting type narrowing idea in https://github.com/KamenKolev/svelte-typed-context/blob/master/index.ts#L14 (yet), probably easier to do together with said breaking change.
    
    closes #8941
    dummdidumm committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    f076646 View commit details
    Browse the repository at this point in the history