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