3 ms·
23 byte version: // Lib code>> s={};call=(n)=>{s[n]()} // << s.hello=()=>console.log('hello'); call('hello'); delete s.hello;
by blatantly 2y ago
23 byte version:
// Lib code>>
s={};call=(n)=>{s[n]()}
// <<
s.hello=()=>console.log('hello');
call('hello');
delete s.hello;
- pavlov 2y agoThis is missing the subscription feature? Multiple independent listeners should be able to attach a callback that fires when “hello” is called.