Skip to content

Instantly share code, notes, and snippets.

View reatexpk's full-sized avatar

Dmitry Lebedev reatexpk

View GitHub Profile
@reatexpk
reatexpk / .eslintrc
Last active June 5, 2019 13:45
Typescript eslint config (airbnb)
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"extends": [
"airbnb",
"prettier",
@reatexpk
reatexpk / custom-props.tsx
Created April 3, 2019 14:32 — forked from iamtmrobinson/custom-props.tsx
Using custom props with a Redux form in Typescript
import * as React from 'react';
import {
Field as FormField,
InjectedFormProps,
reduxForm,
} from 'redux-form';
interface CustomProps {
customText: string;
}
@reatexpk
reatexpk / .eslintrc
Last active June 5, 2019 13:42
Javascript React eslint-config
{
"parser": "babel-eslint",
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"plugins": ["react", "prettier", "react-hooks"],
"rules": {
"react/jsx-filename-extension": 0,
@reatexpk
reatexpk / package.json
Last active June 5, 2019 13:43
Starter kit
{
"name": "app",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"connected-react-router": "^6.3.2",
"history": "^4.9.0",
"normalize.css": "^8.0.1",
"react": "^16.8.6",
import { useEffect, useMemo, useState } from "react";
export const useAbortSignal = () => {
const [abortController] = useState(new AbortController());
const signal = useMemo(() => abortController.signal, [abortController.signal]);
useEffect(
() => () => {
abortController.abort();
},