I like that idea. Channel already has an opts param in its ctor, so I'll just throw a boolean into it.
channel.create('pause', { multi: true }); Created a bug for this: https://issues.apache.org/jira/browse/CB-1274 On Fri, Aug 24, 2012 at 1:46 PM, Gord Tanner <g...@tinyhippos.com> wrote: > I know there was some talk on the mailing list awhile ago of replacing the > channel module with something a little simpler. > > If we do want to patch this issue I would suggest having this done at > construction time. > > var deviceready = channel.create('deviceready', channel.types.once); > var pause = channel.create('pause', channel.types.refireable); > > (naming in example above is for discussion purposes only ;) ) > > On Fri, Aug 24, 2012 at 11:37 AM, Andrew Grieve <agri...@chromium.org > >wrote: > > > I was looking through the channel code and noticed that the fired state > is > > never assigned to false. This makes sense for channels like > onDeviceReady, > > when you'd want this to stay active. But... > > > > It's a bit strange for things like onPause and onResume. It means that if > > the app has ever been paused or resumed, then every new listener going > > forward is going to fire upon subscription even though the current state > is > > not paused/resumed. I tested this out locally, and it appears to be true. > > So... > > > > How about we add a method called "fireOnce", which calls fire() and then > > sets fired = false so that new subscribers will not be immediately > > triggered. > > > > > > -- > Gord Tanner > Senior Developer / Code Poet > tinyHippos Inc. > @tinyhippos >