react-native-yet-another-sortable
Version:
Drag-and-drop sortable scrollable grid view for React Native.
22 lines (19 loc) • 543 B
JavaScript
import { Animated } from 'react-native';
export const animateTiming = (value, toValue, duration, cb) => {
return setTimeout(() => {
Animated.timing(value, { toValue, duration, useNativeDriver: true }).start(cb);
});
};
export const animateWiggle = (value, from, toValue, duration, cb = () => {}) => {
return setTimeout(() => {
value.setValue(from);
Animated.spring(value, {
toValue,
duration,
velocity: 2000,
tension: 2000,
friction: 5,
useNativeDriver: true,
}).start(cb);
});
};