0.0.5 • Published 12 years ago

lua-events v0.0.5

Weekly downloads
4
License
-
Repository
github
Last release
12 years ago

lua-events

Node style events for Lua

Usage

1. Install

Setup lua-loader and then just npm install lua-events

2. Require

local EventEmitter = require("lua-events").EventEmitter

3. Have fun

local myObj = EventEmitter:new({text = "Hello, world!"})
function myObj:talk ()
  self:emit("spoken", self:text)
end
myObj:on("spoken", function (text)
  print("myObj said", text)
end)
myObj:talk()

Limitations

  • Not the complete Node EventEmitter interface; only on, emit, and listeners

History

  • Added in 0.0.5: listeners
  • Fixed in 0.0.4: protected against emitting events w/ no listener
  • New in 0.0.3: properly have an array of listeners per event in stead of just one

License

GNU Lesser General Public License (LGPL)

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2-1

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago