Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Feb 10, 2025
1 parent 2a79f9e commit de3bedf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/javascripts/stimulus_channels/log_channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import BaseCable from './base_cable'
export default class extends BaseCable {

connect() {
const element = this.element
this.subscription = BaseCable.consumer.subscriptions.create({ channel: 'Com::LogChannel', room: 'room' }, {
received(data) {

const p = document.createElement('p')
p.innerText = data
element.appendChild(p)
}
})
}
Expand Down

0 comments on commit de3bedf

Please sign in to comment.