Module: TurboPower::Broadcasts

Defined in:
lib/turbo_power/broadcasts.rb

Constant Summary collapse

ACTIONS =
TurboPower::StreamHelper.instance_methods.sort

Instance Method Summary collapse

Instance Method Details

#custom_broadcast_action_later_to(*streamables, action:, **attributes) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/turbo_power/broadcasts.rb', line 24

def custom_broadcast_action_later_to(*streamables, action:, **attributes)
  TurboPower::Streams::ActionBroadcastJob.perform_later(
    stream_name_from(streamables),
    action: action,
    **attributes
  )
end

#custom_broadcast_action_to(*streamables, action:, **attributes) ⇒ Object



17
18
19
20
21
22
# File 'lib/turbo_power/broadcasts.rb', line 17

def custom_broadcast_action_to(*streamables, action:, **attributes)
  broadcast_stream_to(
    *streamables,
    content: RenderHelper.public_send(action, **attributes)
  )
end