Skip to content

Commit

Permalink
Merge pull request #684 from GoogleCloudPlatform/spp--docs-pubsub-pub…
Browse files Browse the repository at this point in the history
…lish-simplification

docs: simplify pubsub.topic.publish example
  • Loading branch information
stephenplusplus committed Jun 22, 2015
2 parents 6758dfc + d7cc8b0 commit 9a49b79
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/pubsub/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ Topic.prototype.autoCreateWrapper_ = function(method, path, q, body, callback) {
* @param {function=} callback - The callback function.
*
* @example
* topic.publish({
* data: 'Hello, world!'
* }, function(err, messageIds, apiResponse) {});
*
* //-
* // The data property can be a JSON object as well.
* //-
* var registerMessage = {
* data: {
* userId: 3,
Expand All @@ -152,6 +159,7 @@ Topic.prototype.autoCreateWrapper_ = function(method, path, q, body, callback) {
* hello: 'world'
* }
* };
*
* topic.publish(registerMessage, function(err, messageIds, apiResponse) {});
*
* //-
Expand Down

0 comments on commit 9a49b79

Please sign in to comment.