How to wait till PouchDB successfully connects

I am using pouchdb at client side(ionic mobile app) couchdb at server side.

I need to perform operation after pouchdb successfully created and sync with couchdb.

so how can I wait till pouchdb complete initial activity.then after only my client side execution should start.

currently pouch is working on asynchronous manner so sometime before pouch initialize my application starts execution and I am getting error for pouchdb.