cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Parashuram N <>
Subject Re: [DISCUSS] Update to starter template
Date Tue, 16 Feb 2016 03:43:50 GMT
The reason to say that all events are fired after device ready is just to make it simpler.
As you say, events by webviews are indeed fired before that, but I think it is safe to say
that if we attach listeners after deviceready, we are guaranteed to have the plugins also
initialized. This makes for a more consistent story. 

On 2/15/16, 7:25 PM, "Carlos Santana" <> wrote:

>Why do you think that binding is required after "deviceready" ?
>Attaching before "deviceready" fires is still supported for events like
>resume, pause, offline, online, etc.. At least that's always being my
>impression for a long time
>The only thing I would think it could be a potential confusion that would
>benefit to attached after "deviceready" is that if there is an "online" or
>"offline" event fire by webview [1], [2] and not plugin those handlers will
>fire but will not be from the network plugin.
>One thing I like thought about the PR is making index.js less verbose and
>simpler to follow +1
>On Mon, Feb 15, 2016 at 12:36 PM Parashuram N <>
>> While working on documentation about events for Cordova, we noticed that
>> in our Cordova starter template [1] seems to suggest that we bind events
>> like “offline” and “online” alongside the “deviceready” event. As I
>> understand, the “offline” and “online” events are something that the
>> NetworkInformation plugin provides, and thus should only be bound after
>> cordova-js has been initialized.
>> Here [2] is a change where we only bind “deviceready” first, and then
>> recommend binding all events when the handler for “deviceready” is called.
>> Do you folks think this is a good change ? Here [3] is the JIRA for it.
>> [1] Cordova Started template -
>> [2] Pull request with change to starter template -
>> [3] JIRA for PR with change to starter template -

To unsubscribe, e-mail:
For additional commands, e-mail:
View raw message