ajacksified/Mediator.js — Issue #1: Can't unsubscribe to a channel during a publish
Author: twidi
Created: 2012-03-05 13:47:32+00:00
State: open

If i subscribe to a channel many times but i want a callback to be called only once, a way to do this is to call unsubscribe inside the callback.

But doing this updates (logically) the _callbacks array and the loop in Publish fails because the length is checked only at the loop's start.

Is there an another/recommended way to do this ? (run a callback only once)

Thanks in advance.