Skip to content

Commit

Permalink
Remove unnecessary guard
Browse files Browse the repository at this point in the history
It won't monitor anything if the array is empty
  • Loading branch information
jorgemanrubia committed Dec 27, 2024
1 parent ca502ff commit 3161548
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/hotwire/spark/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ def register_monitored_paths

def monitor(paths_name, action:, extensions:)
monitored_paths = Hotwire::Spark.public_send(paths_name)
if monitored_paths.present?
file_watcher.monitor monitored_paths do |changed_path|
broadcast_change(monitored_paths, extensions, changed_path, action)
end
file_watcher.monitor monitored_paths do |changed_path|
broadcast_change(monitored_paths, extensions, changed_path, action)
end
end

Expand Down

0 comments on commit 3161548

Please sign in to comment.