Skip to content

Instantly share code, notes, and snippets.

var waitForDOM = function (callback) {
document.addEventListener("DOMContentLoaded", function () {
setTimeout(function () {
callback();
}, 5000);
});
};
var waitFor = function (callbackValue, callback) {
if (callbackValue()) {
import React from "react";
import ReactDOM from "react-dom";
// REF
const useRefHandler = () => {
const ref = React.useRef();
const [ready, setReady] = React.useState(false);
const set = (node) => {
<h2>1. What are cookies&nbsp;</h2>
<p>
Cookies and similar technologies are very small text documents or pieces of code that often contain a unique
identification code. When you visit a website or use a mobile application, a computer asks your computer or mobile
device for permission to save this file on your computer or mobile device and gain access to information. Information
collected through cookies and similar technologies may include the date and time of the visit and how you use a
particular website or mobile application.&nbsp;
</p>
{
"Necessary": [
"These cookies help you use our website, allowing basic functions such as page navigation and access to secure site areas. The website cannot function properly without these cookies",
[["Name", "Provider", "Purpose", "Expiry", "Type"]]
],
"Preferences": [
"Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.",
[
["Name", "Provider", "Purpose", "Expiry", "Type"],
[
{
"Statistics": [
"Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.",
[
["Name", "Provider", "Purpose", "Expiry", "Type"],
[
"metrika_enabled",
"<a href=\"https://yandex.ru/legal/confidential/?lang=en\">Yandex</a>",
"Used to track visitors on multiple websites, in order to present relevant advertisement based on the visitor's preferences.",
"Session",
{
"Necessary": [
"These cookies help you use our website, allowing basic functions such as page navigation and access to secure site areas. The website cannot function properly without these cookies",
[
["Name", "Provider", "Purpose", "Expiry", "Type"],
["Name", "Provider", "Purpose", "Expiry", "Type"]
]
],
"Preferences": [
"Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.",
const requiredValues = ["name", "country"];
const products = [
{
key: 1,
name: "",
country: "",
},
{
key: 2,
import { useEffect, useRef } from 'react';
export function useEventListener<K extends keyof WindowEventMap>(
eventName: K,
handler: (ev: WindowEventMap[K]) => any,
element = global,
) {
// Create a ref that stores handler
const savedHandler = useRef<(ev: WindowEventMap[K]) => any>();