Skip to content

Instantly share code, notes, and snippets.

View almeidaalex's full-sized avatar
🦖
Focusing

Alex Alves de Almeida almeidaalex

🦖
Focusing
View GitHub Profile
@serradura
serradura / pub_sub.rb
Created May 11, 2022 15:18
Implementação do pub/sub na mão equivalente a gem Wisper
module Susurro
def subscribe(handler)
subscribers << {name: nil, handler: handler}
self
end
def on(event_name, &handler)
subscribers << {name: event_name, handler: handler}