You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Philipp Kursawe <ph...@gmail.com> on 2016/06/21 06:39:31 UTC

Is there a way to wait for another plugin to initialize

I have a plugin that depends on another plugin being initialized first.
Does cordova already provide a documented way of doing that through
channels?

Coming from OSGi I'm thinking of something non-blocking like Plugin B is
only started if Plugin has been started.

Re: Is there a way to wait for another plugin to initialize

Posted by Simon MacDonald <si...@gmail.com>.
Whelp, most plugins have a success callback that is invoked when the
initialization is finished. You can start the second plugin from the
success of the first for a quick win.

Or you could create a custom event:

https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events

Or as you indicated you could use channels.


Simon Mac Donald
http://hi.im/simonmacdonald

On Tue, Jun 21, 2016 at 2:39 AM, Philipp Kursawe <ph...@gmail.com>
wrote:

> I have a plugin that depends on another plugin being initialized first.
> Does cordova already provide a documented way of doing that through
> channels?
>
> Coming from OSGi I'm thinking of something non-blocking like Plugin B is
> only started if Plugin has been started.
>