Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/antonc9018/lua-event-emitter

Lightweight event emitter for lua
https://github.com/antonc9018/lua-event-emitter

lua

Last synced: 5 days ago
JSON representation

Lightweight event emitter for lua

Awesome Lists containing this project

README

        

# lua-event-emitter
A lightweight event emitter for lua.

# How to use
Put the emitter.lua into your project's folder and just require it.

# Example
```lua
local Emitter = require('emitter')

local emitter = Emitter()
local listener = function(a) print(a) end
emitter:on('myevent', listener)
emitter:emit('myevent', 'I will be printed')
```

See some more examples in the file _test.lua_