engine
engine copied to clipboard
Create a better communication config for event emitters
Example of usage in a service
class MyService{
mySignal = new Signal()
}
Example of config in feature
export default class BoardCapabilities extends Feature<"F1"> {
id = "F1" as const;
dependencies = [];
api = {
myService: Service.withType<MyService>()
.defineEntity(processingEnv)
.allowRemoteAccess(asyncSignal("mySignal")),
};
}
The idea is one function asyncSignal
(in this example the name can be changed) should define all the on/off/sub/unsub....
on the emitter.
this will save a lot of boilerplate code in all services and make the entire Signal an AsyncSignal