evental

Event-driven in Crystal

Evental

Evental is a Crystal shard to easily write event-driven code, using callbacks to handle events.

Installation

Add it to Projectfile

deps do
  github "hugoabonizio/evental"
end

Usage

Example of a simple event handler:

require "evental"

emitter = Evental::Emitter.new
emitter.on :open do
  puts "Fake connection opened!"
end
emitter.emit :open
# => Fake connection opened!

Contributing

  1. Fork it ( https://github.com/hugoabonizio/evental/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

evental

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 0
  • almost 8 years ago
  • July 18, 2015
License

MIT License

Links
Synced at

Mon, 06 May 2024 15:58:32 GMT

Languages