mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-04 11:04:58 +00:00
@@ -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: () => {}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user