Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/antonc9018/lua-event-emitter
- Owner: AntonC9018
- License: mit
- Created: 2019-08-17T21:41:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-27T19:22:40.000Z (about 4 years ago)
- Last Synced: 2024-11-17T12:45:42.117Z (2 months ago)
- Topics: lua
- Language: Lua
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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_