Simple and powerful implementation of the observer pattern.
Feature
Features
perform_once: true
into observers.attach()
to define an observer that will execute only once. #8observers.once()
to define callables that will execute only once. #8observers.off()
to remove observers' objects or to remove callables by their event names. #8Improvement
Allow defining callable observers with a context #6
Micro::Observers::Event
Micro::Observers::Event
when the observer's method receives two arguments.Micro::Observers::Event
to the callable observers.notify(:event, data: :something)
, call(data: :something)