Created
April 5, 2013 06:19
-
-
Save junosuarez/5317051 to your computer and use it in GitHub Desktop.
JSDoc vs jsig - callbacks
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
// from http://usejsdoc.org/tags-callback.html | |
//// Documenting a class-specific callback | |
/** | |
* @class | |
*/ | |
function Requester() {} | |
/** | |
* Send a request. | |
* @param {Requester~requestCallback} cb - The callback that handles the response. | |
*/ | |
Requester.prototype.send = function(cb) { | |
// code | |
}; | |
/** | |
* This callback is displayed as part of the Requester class. | |
* @callback Requester~requestCallback | |
* @param {number} responseCode | |
* @param {string} responseMessage | |
*/ |
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
//// Documenting a class-specific callback | |
function Requester() {} | |
// Send a request. | |
// cb: (Number, String) => void | |
Requester.prototype.send = function(cb) { | |
// code | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment