initcb

initcb([successHandler[, errorHandler]])

Asynchronously initialize the dcp-client bundle for use by the compute API, etc. Similar to init() but uses a callback after initialization. If a callback is not needed, use init().

Arguments:
  • successHandler (function) – optional callback which is invoked when finished initialization.

  • errorHandler – optional callback which is invoked when there was an error during initialization.

Example:

const { initcb } = require('dcp-client');

async function main() {
  /* DCP App ... */
}

initcb(main(), (err) => {
  console.error(err);
  process.exit(1);
});