Skip to content

Instantly share code, notes, and snippets.

View oonsamyi's full-sized avatar

Oleg Utitsyn oonsamyi

View GitHub Profile
//Задача 1. Усовершенствуйте кэширующий декоратор
function cachingDecoratorNew(func) {
// Ваш код
let cache = [];
function wrapper(...rest) {
let hash = rest.join(',');
let existResult = cache.find(cacheRecord => cacheRecord.hash === hash);
if (existResult) {
@oonsamyi
oonsamyi / launch.json
Created September 21, 2019 13:46
DEBUG JS: Chrome (public / incoginto), Firefox, Jest (all tests / current test)
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}/src",
// Uncomment this flag if need to set debugger points when chrome already is launched (experimental feature)
@oonsamyi
oonsamyi / enzyme_render_diffs.md
Last active October 21, 2019 07:21 — forked from fokusferit/enzyme_render_diffs.md
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • static getDerivedStateFromProps
export type GetClientByBarcode = {
success: boolean;
message?: string;
result?: {
id: string;
barcode: string;
isDms: boolean;
isChild: boolean;
hasDebt: boolean;
phone: number;
/* flow */
import type {
ClientMisResponse,
VisitsMisResponse,
ServicesMisResponse,
} from '../types/MISResponse';
export type MISResponse = ClientMisResponse | VisitsMisResponse | ServicesMisResponse;