This file contains hidden or 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 { LitElement } from 'lit-element'; | |
import { ScopedElementsMixin } from '@open-wc/scoped-elements'; | |
import { MyPanel } from './MyPanel.js'; | |
| |
export class MyElement extends ScopedElementsMixin(LitElement) { | |
static get scopedElements() { | |
return { | |
'my-panel': MyPanel, | |
}; | |
} |
This file contains hidden or 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 { LitElement, html, css } from 'lit-element'; | |
import { ScopedElementsMixin } from '@open-wc/scoped-elements'; | |
import { FeatureA } from 'feature-a'; | |
import { FeatureB } from 'feature-b'; | |
| |
export class PageA extends ScopedElementsMixin(LitElement) { | |
static get scopedElements() { | |
return { | |
'feature-a': FeatureA, | |
'feature-b': FeatureB, |
This file contains hidden or 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 { LitElement } from 'lit-element'; | |
import { ScopedElementsMixin } from '@open-wc/scoped-elements'; | |
import { MyPanel } from './MyPanel.js'; | |
| |
export class MyElement extends ScopedElementsMixin(LitElement) { | |
static get scopedElements() { | |
return { | |
'my-panel': MyPanel, | |
}; | |
} |
This file contains hidden or 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 { dedupeMixin } from '@open-wc/dedupe-mixin'; | |
export const MyMixin = dedupeMixin( | |
superclass => | |
class MyMixin extends superclass { | |
// your mixin code goes here | |
}, | |
); |
This file contains hidden or 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
npm i @open-wc/dedupe-mixin |
This file contains hidden or 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 { isIE11 } from './helpers.js'; | |
if (isIE11()) {} |
This file contains hidden or 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
class Page {} | |
class PageRed extends Page {} | |
class PageGreen extends Page {} | |
class PageBlue extends Page {} | |
class LoggedPagRed extends PageRed {} |
This file contains hidden or 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
class Page {} | |
class PageRed extends Page {} | |
class PageGreen extends Page {} | |
class PageBlue extends Page {} |
This file contains hidden or 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 { dedupeMixin } from '@open-wc/dedupe-mixin'; | |
export const LocalizeMixin = dedupeMixin( | |
superclass => | |
class LocalizeMixin extends superclass { | |
// this assumes a Mixin for LitElement | |
static get properties() { | |
return { | |
locale: { type: String } | |
}; |
This file contains hidden or 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 { specialAddEventListener } from './helpers.js'; | |
specialAddEventListener(this, 'click', () => console.log('clicked')); |