Open tshemsedinov opened 5 years ago
I added tests that reveal problems and now it’s clear that we need to change data structure for wrappers. Maybe better store them mixed to functions: fn[symbolWrapper] = wrapper
? @nechaido @belochub @lundibundi
Implemented in a different way. Now we hold on
and once
in different data structures for each event separately:
AsyncEmitter {
events:
Map {
'eventName' => {
on: Set { listener<Function> },
once: Map { listener<Function> => wrapper<Function> }
},
}
}
@nechaido @belochub @lundibundi
I suppose we need to hide counters when waiting for multiple event handlers to this abstraction.