Skip to content

Commit

Permalink
Extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemanrubia committed Dec 15, 2024
1 parent 5e0787c commit ae99fea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/hotwire_spark/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae99fea

Please sign in to comment.