为了账号安全,请及时绑定邮箱和手机立即绑定

如何看懂api文档?

如何看懂api文档?

犯罪嫌疑人X 2018-08-09 10:09:56
有没有相关的课程可以学习,经常看api文档看的理解不对,尤其是那些缺少实例代码的。例如下面这一段http://docs.meteor.com/api/pubsub.html#Meteor-subscribeMeteor.subscribe(name, [arg1, arg2...], [callbacks])import { Meteor } from 'meteor/meteor' (ddp-client/livedata_connection.js, line 521)Subscribe to a record set. Returns a handle that provides stop() and ready() methods.ARGUMENTSname StringName of the subscription. Matches the name of the server's publish() call.arg1, arg2... EJSON-able ObjectOptional arguments passed to publisher function on server.callbacks Function or ObjectOptional. May include onStop and onReady callbacks. If there is an error, it is passed as an argument to onStop. If a function is passed instead of an object, it is interpreted as an onReady callback.实际使用callbacks的写法应该是Meteor.subscribe("name",{ onReady:function(){//代码}}但是从文中的描述来看我根本想不到实际的写法应该是这样,不知道应该怎么理解。有没有系统的学习看api文档的教程?求教!
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1657 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信