Rails
, actioncable
npm
cable.subscriptions.create(
{ channel: 'PracticeChannel', room: 'Room5' },
{
received: ({ refetch }) => {
if (refetch) {
// emit some events.
}
}
}
)
如何传递另一个参数,例如 room
我试过,
{ channel: 'PracticeChannel', room: 'Room5', newParam: 'somevalue' }
造成了这个问题
在 Rails 日志中:
Could not execute command from `({"command"=>"subscribe", "identifier"=>"{\"channel\":\"PracticeChannel\",\"room\":Room5}"})`