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

SignalBinding.listener should be private #3

Closed millermedeiros closed 13 years ago

millermedeiros commented 13 years ago

if the user switch the SignalBinding.listener at runtime to a handler already bound to a Signal it will be dispatched twice and will need to call remove twice. Probably create a getter and setter function that checks if handler already exists.

PS: I've never tested it.

millermedeiros commented 13 years ago

not sure what would happen if you try to set a listener that already exists, maybe proper approach would be just having a getter and not a setter, simpler and the user has option to detach and create a new binding anyways. cases where you need to swap handlers should be really uncommon and I don't think worth the trouble.

millermedeiros commented 13 years ago

fixed at commit af477d9c0b29c9c0cb8da25590a0cf7852e51853