millermedeiros / js-signals

Custom Event/Messaging system for JavaScript inspired by AS3-Signals
http://millermedeiros.github.com/js-signals/
1.97k stars 179 forks source link

not sure if `dispose()` is really required #6

Closed millermedeiros closed 13 years ago

millermedeiros commented 13 years ago

considering to remove dispose() method from SignalBinding and maybe not implement it on Signal.

millermedeiros commented 13 years ago

Calling Signal.removeAll() should be enough to the garbage collector delete all SignalBindings.

Detaching binding and deleting local reference to it should be enough for garbage collector.

millermedeiros commented 13 years ago

since I don't know how big/complex the apps built using signals can be I guess it may be a good idea to implement dispose on the Signal object to give users more control about it, specially since user can store references to the signal in many places blocking garbage collection. (even not being required on most cases)

millermedeiros commented 13 years ago

implemented dispose into Signal.prototype and kept SignalBinding.prototype.dipose: 635641375c40c0cb5049c5f8910bcf208bf71a9b