A minimalist event emitter for C++
.
This emitter allows you to emit and receive arbitrary/variadic paramaters of equal type. Captures are also allowed.
#include "deps/datcxx/cxx-eventemitter/index.h"
int main() {
EventEmitter ee;
ee.on("hello", [&](string name, int num) {
// ...do something with the values.
});
ee.emit("hello", "beautiful", 100);
}
This module is designed to work with the datcxx
build tool. To add this
module to your project us the following command...
build add datcxx/cxx-eventemitter
build run test
Listen for an event multiple times.
Listen for an event once.
Emit data for a particular event.
Remove listener for a particular event.
Remove all listeners on the emitter.
Number of listeners an emitter has.
Number of listeners an event emitter should have before considering that there is a memory leak.