A very super simple event system, only three functions: subscribe, unsubscribe and publish. (and a singleton, never mind.)
Supports async. (see main-async in examples)
let handle = singleton.subscribe;
singleton.publish;
singleton.subscribe;
singleton.publish;
singleton.;
singleton.publish;
singleton.subscribe;
singleton.publish;
// with no params, you have to create a struct to distinguish between events
;
Output:
I am 4
I am 6
I am F 6
I am F 8
on login