https://github.com/molnarmark/envy
😑 The Javascript style Event Emitter in MTA:SA
https://github.com/molnarmark/envy
emit emit-events emitter event-emitter events mta mtasa multi-theft-auto
Last synced: 7 months ago
JSON representation
😑 The Javascript style Event Emitter in MTA:SA
- Host: GitHub
- URL: https://github.com/molnarmark/envy
- Owner: molnarmark
- Created: 2018-03-03T11:48:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T18:52:00.000Z (over 7 years ago)
- Last Synced: 2025-03-06T04:56:36.270Z (7 months ago)
- Topics: emit, emit-events, emitter, event-emitter, events, mta, mtasa, multi-theft-auto
- Language: Lua
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 😑 Envy
[](https://github.com/ellerbrock/open-source-badge/)
[](https://github.com/ellerbrock/open-source-badge/)
[](http://makeapullrequest.com)### What is Envy?
Envy is a tiny *(0.4Kb)* Javascript-style Event Emitter that helps you differentiate between MTA events and resource events.\
It's so small that it can be dropped into any resource.### Getting Started
Drop `Envy` into your resource, and initialize it as follows:
```lua
local EnvyEmitter = loadstring(Envy:new())()
```
### The API
`Envy` exposes 3 methods to work with:
- .on(eventName, callback)
- .emit(eventName, payload)
- .once(eventName, payload)### License
MIT### Fancy buying me a beer?
If this project was helpful to you, you can buy me a beer if you feel like doing so. 🙂[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YM7E34E2LT4D8)