Skip to content

Commit

Permalink
Merge pull request #92 from github/check-if-local-time-is-defined
Browse files Browse the repository at this point in the history
🔍check if `<local-time />` is defined before registering
  • Loading branch information
mislav authored Mar 9, 2018
2 parents b1d0d6a + 6572641 commit 256d674
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/local-time-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,7 @@ function formatTime(el) {
// var time = new LocalTimeElement()
// # => <local-time></local-time>
//
window.LocalTimeElement = LocalTimeElement
window.customElements.define('local-time', LocalTimeElement)
if (!window.customElements.get('local-time')) {
window.LocalTimeElement = LocalTimeElement
window.customElements.define('local-time', LocalTimeElement)
}

0 comments on commit 256d674

Please sign in to comment.