services/alchemy_vision/v1.js
function performAction(params, feature, cbdone, cbcleanup) {
    var alchemy_vision = watson.alchemy_vision( { api_key: apikey } );

    if (feature == 'imageFaces')
    {
      alchemy_vision.recognizeFaces(params, cbdone);
    } else if (feature == 'imageLink') {
      alchemy_vision.getImageLinks(params, cbdone);
    } else if (feature == 'imageKeywords') {
      alchemy_vision.getImageKeywords(params, cbdone);
    } else if (feature == 'imageText') {
      alchemy_vision.getImageSceneText(params, cbdone);
    }

    if (cbcleanup) cbcleanup();
  }
function performAction(params, feature, cbdone, cbcleanup) {
    var alchemy_vision = watson.alchemy_vision( { api_key: apikey } );

    if (feature == 'imageFaces')
    {
      alchemy_vision.recognizeFaces(params, cbdone);
    } else if (feature == 'imageLink') {
      alchemy_vision.getImageLinks(params, cbdone);
    } else if (feature == 'imageKeywords') {
      alchemy_vision.getImageKeywords(params, cbdone);
    } else if (feature == 'imageText') {
      alchemy_vision.getImageSceneText(params, cbdone);
    }

    if (cbcleanup) cbcleanup();
  }
function performAction ( params , feature , cbdone , cbcleanup ) { var alchemy_vision = watson . alchemy_vision ( { api_key : apikey } ) ; if ( feature == 'imageFaces' ) { alchemy_vision . recognizeFaces ( params , cbdone ) ; } else if ( feature == 'imageLink' ) { alchemy_vision . getImageLinks ( params , cbdone ) ; } else if ( feature == 'imageKeywords' ) { alchemy_vision . getImageKeywords ( params , cbdone ) ; } else if ( feature == 'imageText' ) { alchemy_vision . getImageSceneText ( params , cbdone ) ; } if ( cbcleanup ) cbcleanup ( ) ; }
Utility function that performs the alchemy vision call. the cleanup removes the temp storage, and I am not sure whether it should be called here or after alchemy returns and passed control back to cbdone.
Utility function that performs the alchemy vision call . the cleanup removes the temp storage and I am not sure whether it should be called here or after alchemy returns and passed control back to cbdone .