Skip to content

Instantly share code, notes, and snippets.

@icsaba
Created May 19, 2022 06:21
Show Gist options
  • Save icsaba/7b4d3ba6c64fe00b6fd2d5b1e298465f to your computer and use it in GitHub Desktop.
Save icsaba/7b4d3ba6c64fe00b6fd2d5b1e298465f to your computer and use it in GitHub Desktop.
code snippet for my medium article
class MyLitComponent extends LitElement {
static get properties() {
return {
somepropFromContext: {
type: Number,
fromContext: true
},
renamedProp: {
type: String,
fromContext: true,
contextKey: 'somepropInTheStore'
}
};
}
}
window.customElements.define('my-lit-component', context.connect(MyLitComponent));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment