I think it's time for a review of this module and how it fits into cordova-js. Spell out exactly what we need from it, and then find a suitable replacement or do a rewrite. A few of the channels have specific firing needs e.g. deviceready. I think we can get something much smaller/simpler in there.
If I remember correctly, I hacked this out of complete ui, a Nitobi-written UI library from like.. 2007. Pretty sure it's Dave Johnson's code too! It may have been too much for our purposes any ways. On 8/24/12 12:15 PM, "Andrew Grieve" <agri...@chromium.org> wrote: >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 >>