From a453e4462a17ec03ee14aa4fd102c24fabe0136e Mon Sep 17 00:00:00 2001 From: Mohammad Aboelnour Date: Mon, 18 Dec 2023 01:33:00 +0200 Subject: [PATCH] Add Wisper.clear to prevent of adding multiple listeners in case of development env --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5f57aed..fd205fe 100644 --- a/README.md +++ b/README.md @@ -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 ```