Skip to content

Commit

Permalink
Inline requires in JSTimers
Browse files Browse the repository at this point in the history
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 9342f25
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Libraries/Core/Timers/JSTimers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9342f25

Please sign in to comment.