initcb

initcb([successHandler[, errorHandler]])

Asynchronously initialize the dcp-client bundle for use by the compute API, etc. before

Arguments
  • successHandler (function()) – optional callback which is invoked when we have finished initialization

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

Example usage

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

initcb(
  (dcp) => {
    const compute = require('dcp/compute');
    // or
    // const { compute } = dcp;
  },
  (err) => {
    console.error(err);
    process.exit(1);
  },
);