Skip to content

Commit

Permalink
Ensure the turbo-echo-stream-source custom element is only defined once
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Dec 28, 2022
1 parent e348ae2 commit d3f5ad8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stubs/resources/js/elements/turbo-echo-stream-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ class TurboEchoStreamSourceElement extends HTMLElement {
}
}

customElements.define('turbo-echo-stream-source', TurboEchoStreamSourceElement)
if (customElements.get('turbo-echo-stream-source') === undefined) {
customElements.define('turbo-echo-stream-source', TurboEchoStreamSourceElement)
}

0 comments on commit d3f5ad8

Please sign in to comment.