Stop listening context
Closed this issue · 4 comments
untemps commented
Hi,
as I add a listener on the context to get the asynchronous result of a command, I would like to remove it as soon as I don't need it anymore.
Would it be possible to add a stopListen method bound on the backbone stopListening method?
Thanks.
Vincent.
geekdave commented
geekdave commented
@untemps : Correct, this is not implemented yet. But you could temporarily work around it yourself like so:
Assuming you are working inside a Backbone View, which has a reference to a Context called myContext
:
this.listenToOnce(this.myContext.vent, "someEvent", this.someCallback)
Will try to get this implemented soon. Let me know if the workaround does the trick for now. It's not the cleanest, since the Context's vent
property is supposed to be "private".