Skip to content

Commit

Permalink
Add Wisper.clear to prevent of adding multiple listeners in case of d…
Browse files Browse the repository at this point in the history
…evelopment env
  • Loading branch information
maboelnour authored Dec 17, 2023
1 parent 5587c1a commit a453e44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ In a Rails app you might want to add your global listeners in an initializer lik
```ruby
# config/initializers/listeners.rb
Rails.application.reloader.to_prepare do
Wisper.clear if Rails.env.development?

Wisper.subscribe(MyListener.new)
end
```
Expand Down

0 comments on commit a453e44

Please sign in to comment.