Returns promise that resolves when initialization is complete.
/**
* @name ready
* @summary returns promise that resolves when initialization is complete
* @return {object} promise - resolving if init success or rejecting otherwise
*/
ready()If you are using hydra in the same file it's being initialized in, then you can wait directly on the promise returned by hydra.init() before proceding with other hydra methods.
// index.js
hydra.init({...})
.then(...);However, if you are importing your hydra instance from a separate file, you will need to call the hydra.ready() method. hydra.ready() returns the exact same promise that hydra.init() does, though it does so without re-initializing the hydra instance.
// my-hydra.js
import hydra from 'hydra';
hydra.init({...});
export default hydra;// service.js
import hydra from './my-hydra.js';
hydra.ready().then(...);You can use hydra.ready() any time after you have called hydra.init() to wait for initialization to complete.
+1