Created
November 23, 2022 16:52
-
-
Save heyMP/b277e5fdbe491d8bb0c6b89097520121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as C from '@lit-labs/context'; | |
class S<T extends C.ContextKey<unknown, unknown>> { | |
constructor( | |
public host: HTMLElement, | |
public context: T, | |
public provider: C.ContextType<T>, | |
) {} | |
} | |
interface P { | |
hi: 'there' | |
} | |
const el = new HTMLElement(); | |
const c = C.createContext<P>('hi'); | |
const s = new S(el, c, {}); | |
s.provider.hi; | |
const d = C.createContext<number>('there'); | |
new S(el, d, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment