2014-11-21 97 views
0

(Meteor.js库1.x版)Meteor.setTimeout不返回处理服务器端

当我可以调用Meteor.setTimeout()客户端它做什么,我期待并返回一个句柄(本质上是一个号),我可以在以后使用clearTimeout等等 - 当我打电话Meteor.setTimeout()服务器端返回的是一个对象,它看起来像这样:

{ _idleTimeout: 1, 
    _idlePrev: 
    { _idleNext: [Circular], 
     _idlePrev: [Circular], 
     msecs: 1, 
    ontimeout: [Function: listOnTimeout] }, 
    _idleNext: 
    { _idleNext: [Circular], 
     _idlePrev: [Circular], 
     msecs: 1, 
     ontimeout: [Function: listOnTimeout] }, 
     _idleStart: 1416549645303, 
     _onTimeout: [Function], 
     _repeat: false } 

任何想法?

回答

0

我测试过一个正常的node.js REPL,这就是setTimeout返回的结果。传递给Meteor.clearTimeout应该可以正常工作。唯一的问题是文档错误地指出Meteor.clearTimeoutMeteor.clearInterval的参数的类型为Number,而它只在客户端上具有该类型。