Last active
August 29, 2015 14:15
-
-
Save jaw187/27e559b07a08b5746466 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CameraShare = function (cameraId, username, target) { | |
this.cameraId = cameraId; | |
this.fromName = username; | |
this.target = target; | |
this.branchUrl = function(cb) { | |
branchUrl = "http://www.google.com/" | |
cb(branchUrl); | |
}; | |
} | |
CameraShare.prototype.toString = function(cb) { | |
var self = this; | |
this.branchUrl(function(url) { | |
cb("Hello target, " + self.fromName + "wants to share" + self.cameraId + " with you using this link: "+url); | |
}); | |
}; | |
exports.shareCameraIdFromUsernameToTargets = function(cameraId, username, targets) { | |
console.log("targets", targets); | |
for (var i = 0; i < targets.length; i++) { | |
var cameraShare = new CameraShare(cameraId, username, targets[i]) | |
console.log(cameraShare.toString()); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment