react-native-screen-transitions
Version:
Easy screen transitions for React Native and Expo
35 lines (34 loc) • 764 B
JavaScript
;
import { makeMutable } from "react-native-reanimated";
const store = {};
function ensure(routeKey) {
let bag = store[routeKey];
if (!bag) {
bag = {
x: makeMutable(0),
y: makeMutable(0),
normalizedX: makeMutable(0),
normalizedY: makeMutable(0),
isDismissing: makeMutable(0),
isDragging: makeMutable(0),
direction: makeMutable(null)
};
store[routeKey] = bag;
}
return bag;
}
function getGesture(routeKey, gestureKey) {
return ensure(routeKey)[gestureKey];
}
function getRouteGestures(routeKey) {
return ensure(routeKey);
}
function clear(routeKey) {
delete store[routeKey];
}
export const Gestures = {
getGesture,
getRouteGestures,
clear
};
//# sourceMappingURL=gestures.js.map