Permalink
Browse files

Inline requires in JSTimers

Reviewed By: javache

Differential Revision: D5466322

fbshipit-source-id: 0bcc71e19cdb48d95b5e35ae2f720d46baf9bb50
  • Loading branch information...
fromcelticpark authored and facebook-github-bot committed Jul 24, 2017
1 parent 5da7629 commit 9342f25d5fcb91c9f2951445dcc853a48e26ceb6
Showing with 9 additions and 4 deletions.
  1. +9 −4 Libraries/Core/Timers/JSTimers.js
@@ -16,13 +16,18 @@ const Platform = require('Platform');
const Systrace = require('Systrace');
const invariant = require('fbjs/lib/invariant');
const performanceNow = require('fbjs/lib/performanceNow');
const warning = require('fbjs/lib/warning');
const {Timing} = require('NativeModules');
import type {ExtendedError} from 'parseErrorStack';
let _performanceNow = null;
function performanceNow() {
if (!_performanceNow) {
_performanceNow = require('fbjs/lib/performanceNow');
}
return _performanceNow();
}
/**
* JS implementation of timer functions. Must be completely driven by an
* external clock signal, all that's stored here is timerID, timer type, and
@@ -96,7 +101,7 @@ function _allocateCallback(func: Function, type: JSTimerType): number {
* recurring (setInterval).
*/
function _callTimer(timerID: number, frameTime: number, didTimeout: ?boolean) {
warning(
require('fbjs/lib/warning')(
timerID <= GUID,
'Tried to call timer with ID %s but no such timer exists.',
timerID,

0 comments on commit 9342f25

Please sign in to comment.