Skip to content

Instantly share code, notes, and snippets.

View kate0n's full-sized avatar
:octocat:
Working from home

Ekaterina Mikhailina kate0n

:octocat:
Working from home
View GitHub Profile
@kate0n
kate0n / gist:b65f6810e7ad8bba376c57b8923bf2c1
Last active January 6, 2024 21:24
Integration module with OZON API
import axios from "axios";
import {useMutation} from "react-query";
import {useGetUser} from "../../../api/user/index";
const url = "https://api-seller.ozon.ru/v2/product/info";
const postQuery = (data) =>
axios.post(
url,
@kate0n
kate0n / App.js
Last active January 5, 2023 15:33
Compose React context providers
import React from "react";
import Compose from "./Compose.js";
import Context from "./Context.js";
export default function App() {
const [foo] = React.useState(1);
const [bar] = React.useState(2);
return (
<Compose
var object_create = Object.create;
if (typeof object_create !== 'function') {
object_create = function(o) {
function F() {}
F.prototype = o;
return new F();
};
}
function deepClone(src) {
if(src === null || typeof(src) !== 'object'){
Object.defineProperty(Object, 'assign', {
enumerable: false,
configurable: true,
writable: true,
value: function(target) {
'use strict';
if (target === undefined || target === null) {
throw new TypeError('First argument is empty');
}
const [y, setY] = useState(window.scrollY);
const handleNavigation = useCallback(
(e) => {
const window = e.currentTarget;
if (y > window.scrollY) {
console.log("scrolling up");
setHeaderHidden(false);
} else if (y - window.scrollY < -10) {
setHeaderHidden(true);