How to use the coinstac-common.helpers function in coinstac-common

To help you get started, we’ve selected a few coinstac-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trendscenter / coinstac / packages / coinstac-client-core / src / sub-api / project-service.js View on Github external
getDBListener({ callback, consortiumId, projectId }) {
    if (!consortiumId) {
      throw new Error('Consortium ID required');
    } else if (!callback || !(callback instanceof Function)) {
      throw new Error('Callback function required');
    }

    // Deep props are unfortunately necessary for testing:
    const dbListener = new coinstacCommon.helpers.DBListener(
      this.dbRegistry.get(`remote-consortium-${consortiumId}`)
    );

    dbListener.on('change', ({ doc }) => {
      ProjectService.handleRemoteResultChange({
        callback,
        consortiumId,
        doc,
        projectId,
      });
    });
    dbListener.on('delete', ({ doc }) => {
      ProjectService.handleRemoteResultDelete({
        callback,
        consortiumId,
        doc,

coinstac-common

COINSTAC core functionality.

MIT
Latest version published 1 month ago

Package Health Score

73 / 100
Full package analysis

Similar packages