react-grecaptcha-v3
Version:
Google Recaptcha V3 for React.js based application. Keep website performance high while prioritizing security.
17 lines (16 loc) • 416 B
JavaScript
import globalOnLoad from './global/globalOnLoad';
import { key, queueKey } from './global/globals';
const subscribeEvent = (callback) => {
if (window.grecaptcha?.execute) {
callback();
return;
}
window[key] = globalOnLoad;
if (window[queueKey]) {
window[queueKey].push(callback);
}
else {
window[queueKey] = [callback];
}
};
export default subscribeEvent;