run = (unsubs) => (
// can unsubs be modified in run functions?
unsubs.forEach(fn => fn()), // performance problem here (for of more quick)
unsubs.clear()
),
"for of" perf problem
And return "detach" function no have a reason in most cases:
attach = (unsubs, fn) => (
(fn || (fn = unsubs, unsubs = context_unsubs)), <---------- remove "||" performance reason
unsubs && unsubs.add(fn),
() => unsubs.delete(fn) // <--------------- remove it performance and size reason
),
It should be super small and super fast!
p.s.
May be rewrite back to Array from Set.
May be remove "unsubscriber" function (it's so long name) and type in documentation what it is an array.