Created
May 31, 2018 18:18
-
-
Save estevaolucas/cd99f1cd59894cd2cf1773ac6307982f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React from 'react'; | |
import { TouchableOpacity } from 'react-native'; | |
import debounce from 'lodash.debounce'; | |
const TouchableDebounce = ({ | |
children, | |
onPress, | |
...props | |
}: TouchableOpacity): TouchableOpacity => ( | |
<TouchableOpacity onPress={ debounce(onPress, 500) } { ...props }> | |
{children} | |
</TouchableOpacity> | |
); | |
export default TouchableDebounce; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment