[fix] update InteractionManager stub

Fix #875
This commit is contained in:
Nicolas Gallagher
2018-03-29 15:32:32 -07:00
parent 8e94d858b2
commit b239cfb04d

View File

@@ -20,9 +20,18 @@ const InteractionManager = {
/**
* Schedule a function to run after all interactions have completed.
*/
runAfterInteractions(callback: Function) {
invariant(typeof callback === 'function', 'Must specify a function to schedule.');
callback();
runAfterInteractions(task: ?Function): { then: Function, done: Function, cancel: Function } {
console.warn('InteractionManager is not supported on web');
const promise = new Promise(resolve => {
if (task) {
resolve(task());
}
});
return {
then: promise.then.bind(promise),
done: () => {},
cancel: () => {}
};
},
/**