Split from #30, in which @mhn65536 suggested that the cost of unused events (i.e. with no subscribers) could be reduced.
Although the approach suggested by @mhn65536 cannot be used due to thread-safety reasons, there's a way to make things better by lazily allocating the handlers collection. The WeakEventSource instance will still be allocated.
Split from #30, in which @mhn65536 suggested that the cost of unused events (i.e. with no subscribers) could be reduced.
Although the approach suggested by @mhn65536 cannot be used due to thread-safety reasons, there's a way to make things better by lazily allocating the handlers collection. The
WeakEventSource
instance will still be allocated.