Created
February 18, 2020 12:24
-
-
Save daKmoR/88bd44f090c6a107893bb9c57845ecb0 to your computer and use it in GitHub Desktop.
Markdium-What is a 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 { 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 } | |
}; | |
} | |
updated(changedProperties) { | |
super.updated(changedProperties); | |
if (changedProperties.has('locale')) { | |
// react to locale change | |
} | |
} | |
}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment