Skip to content

Commit

Permalink
InteractionManager: remove dev timeout warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
josephsavona committed Jul 1, 2015
1 parent 5418cdf commit 776dc97
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions Libraries/Interaction/InteractionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ var setImmediate = require('setImmediate');

type Handle = number;

/**
* Maximum time a handle can be open before warning in DEV.
*/
var DEV_TIMEOUT = 2000;

var _emitter = new EventEmitter();
var _interactionSet = new Set();
var _addInteractionSet = new Set();
Expand Down Expand Up @@ -94,14 +89,6 @@ var InteractionManager = {
scheduleUpdate();
var handle = ++_inc;
_addInteractionSet.add(handle);
if (__DEV__) {
// Capture the stack trace of what created the handle.
var error = new Error(
'InteractionManager: interaction handle not cleared within ' +
DEV_TIMEOUT + ' ms.'
);
setDevTimeoutHandle(handle, error, DEV_TIMEOUT);
}
return handle;
},

Expand Down Expand Up @@ -166,19 +153,4 @@ function processUpdate() {
_deleteInteractionSet.clear();
}

/**
* Wait until `timeout` has passed and warn if the handle has not been cleared.
*/
function setDevTimeoutHandle(
handle: Handle,
error: Error,
timeout: number
): void {
setTimeout(() => {
if (_interactionSet.has(handle)) {
console.warn(error.message + '\n' + error.stack);
}
}, timeout);
}

module.exports = InteractionManager;

0 comments on commit 776dc97

Please sign in to comment.