Oleg Varaksin
Jan 25 · 1 min read

Hey, you have a very lightweight impl. of eventbus! I have a little suggestion. You don’t need to generate UUIDs as keys. Just use Symbols. They are tokens that serve as unique IDs. Look:

let obj = {};
let key = Symbol();
obj[key] = “123”;
key = Symbol();
obj[key] = “345”;

Now, you have obj as:
{Symbol(): “123”, Symbol(): “345”}

What do you think?

    Oleg Varaksin

    Written by

    Thoughts on software development. Author of “PrimeFaces Cookbook” and “Angular UI Development with PrimeNG”. My old blog: http://ovaraksin.blogspot.de