class MyListener
on_event "recruitment/monthly_total_updated" do |payload|
# ...
end
end
broadcast("recruitment/monthly_total_updated", payload)
instead of
class MyListener
def recruitment__monthly_total_updated(payload)
# ...
end
end
broadcast(:recruitment__monthly_total_update, payload) # double underscore used to seperate namespace and event name
When an event name is a symbol then it could still be matched to on_event("recruitment/...")
.
on_event would need to be eval'd in context of object so it has access to private methods etc.