sid-address-verification-react-native
Version:
A sourceID react native package for address verification
25 lines (20 loc) • 626 B
text/typescript
import { GOOGLE_PLACES_KEY } from '@env';
// Google Places API configuration
const GOOGLE_PLACES_BASE_URL = 'https://maps.googleapis.com/maps/api/place';
// Simple utility functions
const debounce = (func: Function, delay: number) => {
let timeoutId: NodeJS.Timeout;
return (...args: any[]) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => func.apply(null, args), delay);
};
};
const generateSessionToken = (): string => {
return `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
};
export {
GOOGLE_PLACES_BASE_URL,
GOOGLE_PLACES_KEY,
debounce,
generateSessionToken,
};