Add some more doc comments

This commit is contained in:
Sashko Stubailo
2014-09-05 09:31:41 -07:00
parent 586b6e2712
commit aeff585f79
6 changed files with 66 additions and 14 deletions

View File

@@ -196,7 +196,7 @@ publish handler, this is the place to stop the observes.
{{> autoApiBox "Subscription#stop"}}
{{> autoApiBox "Subscription#connection"}}
{{> api_box subscribe}}
{{> autoApiBox "Meteor.subscribe"}}
When you subscribe to a record set, it tells the server to send records to the
client. The client stores these records in local [Minimongo
@@ -364,7 +364,7 @@ a `Meteor.Error`, then that error will be sent to the client. Otherwise, if no
sanitized version is available, the client gets
`Meteor.Error(500, 'Internal server error')`.
{{> api_box meteor_call}}
{{> autoApiBox "Meteor.call"}}
This is how to invoke a method. It will run the method on the server. If a
stub is available, it will also run the stub on the client. (See also
@@ -418,7 +418,7 @@ you want to process the method's result as soon as it arrives from the server,
even if the method's writes are not available yet, you can specify an
`onResultReceived` callback to [`Meteor.apply`](#meteor_apply).
{{> api_box meteor_apply}}
{{> autoApiBox "Meteor.apply"}}
`Meteor.apply` is just like `Meteor.call`, except that the method arguments are
passed as an array rather than directly as arguments, and you can specify
@@ -2695,8 +2695,7 @@ present on template objects:
{{> autoApiBox "Blaze.isTemplate"}}
{{#api_box renderable_content}}
{{> apiBoxTitle name="Renderable Content" id="renderable_content"}}
A value is *renderable content* if it is one of the following:
@@ -2710,8 +2709,6 @@ as well, but these objects are not yet part of the officially-supported,
public API.
{{/note}}
{{/api_box}}
<h2 id="match"><span>Match</span></h2>
Meteor methods and publish functions take arbitrary [EJSON](#ejson) types as
@@ -2746,7 +2743,7 @@ server logs but not revealed to the client.
{{> api_box match_test}}
{{#api_box matchpatterns}}
{{> apiBoxTitle name="Match Patterns" id="matchpatterns"}}
The following patterns can be used as pattern arguments to `check` and `Match.test`:
@@ -2826,8 +2823,6 @@ from the call to `check` or `Match.test`. Examples:
{{/dtdd}}
</dl>
{{/api_box}}
<h2 id="timers"><span>Timers</span></h2>
Meteor uses global environment variables

File diff suppressed because one or more lines are too long

View File

@@ -121,5 +121,30 @@ nameToId = {
"Template.instance": "template_instance",
"Template.currentData": "template_currentdata",
"Template.parentData": "template_parentdata",
"Template.body": "template_body"
"Template.body": "template_body",
"ReactiveVar": "reactivevar",
"ReactiveVar#get": "reactivevar_get",
"ReactiveVar#set": "reactivevar_set",
"HTTP.get": "http_get",
"HTTP.post": "http_post",
"HTTP.put": "http_put",
"HTTP.del": "http_del",
"Email.send": "email_send",
"Assets.getText": "assets_getText",
"Assets.getBinary": "assets_getBinary",
"Blaze.render": "blaze_render",
"Blaze.renderWithData": "blaze_renderwithdata",
"Blaze.View": "blaze_view",
"Blaze.remove": "blaze_remove",
"Blaze.getData": "blaze_getdata",
"Blaze.toHTML": "blaze_tohtml",
"Blaze.toHTMLWithData": "blaze_tohtmlwithdata",
"Blaze.currentView": "blaze_currentview",
"Blaze.getView": "blaze_getview",
"Blaze.With": "blaze_with",
"Blaze.If": "blaze_if",
"Blaze.Unless": "blaze_unless",
"Blaze.Each": "blaze_each",
"Blaze.Template": "blaze_template",
"Blaze.isTemplate": "blaze_istemplate"
};

View File

@@ -64,6 +64,8 @@
"Meteor",
"Meteor.Error",
"Meteor.absoluteUrl",
"Meteor.apply",
"Meteor.call",
"Meteor.clearInterval",
"Meteor.clearTimeout",
"Meteor.disconnect",
@@ -84,6 +86,7 @@
"Meteor.settings",
"Meteor.startup",
"Meteor.status",
"Meteor.subscribe",
"Meteor.user",
"Meteor.userId",
"Meteor.users",
@@ -161,6 +164,5 @@
"Tracker.currentComputation",
"Tracker.flush",
"Tracker.nonreactive",
"Tracker.onInvalidate",
"initFromPackageDir~api.use"
"Tracker.onInvalidate"
]

View File

@@ -460,6 +460,14 @@ _.extend(Connection.prototype, {
return true;
},
/**
* @memberOf Meteor
* @summary Subscribe to a record set. Returns a handle that provides `stop()` and `ready()` methods.
* @locus Client
* @param {String} name Name of the subscription. Matches the name of the server's `publish()` call.
* @param {Any} [arg1,arg2...] Optional arguments passed to publisher function on server.
* @param {Function|Object} [callbacks] Optional. May include `onError` and `onReady` callbacks. If a function is passed instead of an object, it is interpreted as an `onReady` callback.
*/
subscribe: function (name /* .. [arguments] .. (callback|callbacks) */) {
var self = this;
@@ -618,6 +626,14 @@ _.extend(Connection.prototype, {
});
},
/**
* @memberOf Meteor
* @summary Invokes a method passing any number of arguments.
* @locus Anywhere
* @param {String} name Name of method to invoke
* @param {EJSONable} [arg1,arg2...] Optional method arguments
* @param {Function} [asyncCallback] Optional callback, which is called asynchronously with the error or result after the method is complete. If not provided, the method runs synchronously if possible (see below).
*/
call: function (name /* .. [arguments] .. callback */) {
// if it's a function, the last argument is the result callback,
// not a parameter to the remote method.
@@ -647,6 +663,18 @@ _.extend(Connection.prototype, {
// be confused with server return values; we
// may improve this in future.
// @param callback {Optional Function}
/**
* @memberOf Meteor
* @summary Invoke a method passing an array of arguments.
* @locus Anywhere
* @param {String} name Name of method to invoke
* @param {EJSONable[]} args Method arguments
* @param {Object} [options]
* @param {Boolean} options.wait (Client only) If true, don't send this method until all previous method calls have completed, and don't send any subsequent method calls until this one is completed.
* @param {Function} options.onResultReceived (Client only) This callback is invoked with the error or result of the method (just like `asyncCallback`) as soon as the error or result is available. The local cache may not yet reflect the writes performed by the method.
* @param {Function} [asyncCallback] Optional callback; same semantics as in [`Meteor.call`](#meteor_call).
*/
apply: function (name, args, options, callback) {
var self = this;

View File

@@ -27,6 +27,8 @@
*/
/**
* @class
* @instanceName reactiveVar
* @summary Constructor for a ReactiveVar, which represents a single reactive variable.
* @locus Client
* @param {Any} initialValue The initial value to set. `equalsFunc` is ignored when setting the initial value.