packages/weex-vue-framework/index.js
function getInstanceTimer (
  instanceId,
  moduleGetter
) {
  var instance = instanceOptions[instanceId];
  var timer = moduleGetter('timer');
  var timerAPIs = {
    setTimeout: function () {
      var args = [], len = arguments.length;
      while ( len-- ) args[ len ] = arguments[ len ];

      var handler = function () {
        args[0].apply(args, args.slice(2));
      };

      timer.setTimeout(handler, args[1]);
      return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
    },
    setInterval: function () {
      var args = [], len = arguments.length;
      while ( len-- ) args[ len ] = arguments[ len ];

      var handler = function () {
        args[0].apply(args, args.slice(2));
      };

      timer.setInterval(handler, args[1]);
      return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
    },
    clearTimeout: function (n) {
      timer.clearTimeout(n);
    },
    clearInterval: function (n) {
      timer.clearInterval(n);
    }
  };
  return timerAPIs
}
function getInstanceTimer (
  instanceId,
  moduleGetter
) {
  var instance = instanceOptions[instanceId];
  var timer = moduleGetter('timer');
  var timerAPIs = {
    setTimeout: function () {
      var args = [], len = arguments.length;
      while ( len-- ) args[ len ] = arguments[ len ];

      var handler = function () {
        args[0].apply(args, args.slice(2));
      };

      timer.setTimeout(handler, args[1]);
      return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
    },
    setInterval: function () {
      var args = [], len = arguments.length;
      while ( len-- ) args[ len ] = arguments[ len ];

      var handler = function () {
        args[0].apply(args, args.slice(2));
      };

      timer.setInterval(handler, args[1]);
      return instance.document.taskCenter.callbackManager.lastCallbackId.toString()
    },
    clearTimeout: function (n) {
      timer.clearTimeout(n);
    },
    clearInterval: function (n) {
      timer.clearInterval(n);
    }
  };
  return timerAPIs
}
function getInstanceTimer ( instanceId , moduleGetter ) { var instance = instanceOptions [ instanceId ] ; var timer = moduleGetter ( 'timer' ) ; var timerAPIs = { setTimeout : function ( ) { var args = [ ] , len = arguments . length ; while ( len -- ) args [ len ] = arguments [ len ] ; var handler = function ( ) { args [ 0 ] . apply ( args , args . slice ( 2 ) ) ; } ; timer . setTimeout ( handler , args [ 1 ] ) ; return instance . document . taskCenter . callbackManager . lastCallbackId . toString ( ) } , setInterval : function ( ) { var args = [ ] , len = arguments . length ; while ( len -- ) args [ len ] = arguments [ len ] ; var handler = function ( ) { args [ 0 ] . apply ( args , args . slice ( 2 ) ) ; } ; timer . setInterval ( handler , args [ 1 ] ) ; return instance . document . taskCenter . callbackManager . lastCallbackId . toString ( ) } , clearTimeout : function ( n ) { timer . clearTimeout ( n ) ; } , clearInterval : function ( n ) { timer . clearInterval ( n ) ; } } ; return timerAPIs }
DEPRECATED
Generate HTML5 Timer APIs. An important point is that the callback
will be converted into callback id when sent to native. So the
framework can make sure no side effect of the callback happened after
an instance destroyed.
DEPRECATED Generate HTML5 Timer APIs . An important point is that the callback will be converted into callback id when sent to native . So the framework can make sure no side effect of the callback happened after an instance destroyed .