incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gord Tanner <>
Subject Re: and onPause/onResume
Date Fri, 24 Aug 2012 17:46:20 GMT
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 <>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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message