diff --git a/lib/hotwire_spark/installer.rb b/lib/hotwire_spark/installer.rb index c6fd1cda..f5b7d07c 100644 --- a/lib/hotwire_spark/installer.rb +++ b/lib/hotwire_spark/installer.rb @@ -39,10 +39,14 @@ def register_monitored_paths def monitor(paths_name, action:) file_watcher.monitor HotwireSpark.public_send(paths_name) do |file_path| - ActionCable.server.broadcast "hotwire_spark", reload_message_for(action, file_path) + broadcast_reload_action(action, file_path) end end + def broadcast_reload_action(action, file_path) + ActionCable.server.broadcast "hotwire_spark", reload_message_for(action, file_path) + end + def reload_message_for(action, file_path) { action: action, path: file_path } end