react-native-gesture-handler
Version:
Experimental implementation of a new declarative API for gesture handling in react-native
20 lines (18 loc) • 760 B
JavaScript
import { Platform } from 'react-native';
let EXPERIMENTAL_WEB_IMPLEMENTATION = false;
let getWasCalled = false;
export function enableExperimentalWebImplementation(shouldEnable = true) {
if (Platform.OS !== 'web' || EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable) {
return;
}
if (getWasCalled) {
console.error('Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.');
return;
}
EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;
}
export function isExperimentalWebImplementationEnabled() {
getWasCalled = true;
return EXPERIMENTAL_WEB_IMPLEMENTATION;
}
//# sourceMappingURL=EnableExperimentalWebImplementation.js.map