@uscreentv/turbo-train
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "@uscreentv/turbo-train", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "turbo-train.js", |
@@ -5,3 +5,3 @@ import { Turbo } from "@hotwired/turbo-rails" | ||
static get observedAttributes() { | ||
return [ 'href', 'session', 'name' ]; | ||
return [ 'href' ]; | ||
} | ||
@@ -14,3 +14,3 @@ | ||
connectedCallback() { | ||
this.eventSource = new EventSource(`${this.href}/mercure?topic=${this.name}&authorization=${this.session}`); | ||
this.eventSource = new EventSource(this.href); | ||
Turbo.connectStreamSource(this.eventSource); | ||
@@ -26,10 +26,2 @@ } | ||
} | ||
get session() { | ||
return this.getAttribute('session'); | ||
} | ||
get name() { | ||
return this.getAttribute('name'); | ||
} | ||
} | ||
@@ -36,0 +28,0 @@ |
@@ -1,1 +0,1 @@ | ||
import{Turbo as e}from"@hotwired/turbo-rails";export default class t extends HTMLElement{static get observedAttributes(){return["href","session","name"]}constructor(){super()}connectedCallback(){this.eventSource=new EventSource(`${this.href}/mercure?topic=${this.name}&authorization=${this.session}`),e.connectStreamSource(this.eventSource)}disconnectedCallback(){e.disconnectStreamSource(this.eventSource)}get href(){return this.getAttribute("href")}get session(){return this.getAttribute("session")}get name(){return this.getAttribute("name")}};"undefined"==typeof window||window.customElements.get("turbo-train-stream-source")||window.customElements.define("turbo-train-stream-source",t); | ||
import{Turbo as e}from"@hotwired/turbo-rails";export default class t extends HTMLElement{static get observedAttributes(){return["href"]}constructor(){super()}connectedCallback(){this.eventSource=new EventSource(this.href),e.connectStreamSource(this.eventSource)}disconnectedCallback(){e.disconnectStreamSource(this.eventSource)}get href(){return this.getAttribute("href")}};"undefined"==typeof window||window.customElements.get("turbo-train-stream-source")||window.customElements.define("turbo-train-stream-source",t); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1812
27
1