Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| |
| import React, { forwardRef } from 'react' | |
| import styled from 'styled-components' | |
| import css, { get } from '@styled-system/css' | |
| import { | |
| system, | |
| compose, | |
| space, | |
| color, | |
| typography, | |
| layout, |
| import axios from 'axios'; | |
| class Service { | |
| constructor() { | |
| let service = axios.create({ | |
| headers: {csrf: 'token'} | |
| }); | |
| service.interceptors.response.use(this.handleSuccess, this.handleError); | |
| this.service = service; | |
| } |
| ls -al ~/.ssh | |
| # | |
| # generate ssh key | |
| # | |
| ssh-keygen -t rsa -C "email@work_mail.com" -f "id_rsa_work_user1" | |
| # | |
| #Adding the new SSH key to the corresponding GitHub account | |
| # |
Add the new key to your GitHub/BitBucket account
| Credit to | |
| https://medium.com/javascript-in-plain-english/react-controlled-forms-with-hooks-538762aab935 | |
| import React, { ChangeEvent, FormEvent, useReducer } from "react"; | |
| const useForm = (initialState: any) => { | |
| const reducer = ( | |
| state: typeof initialState, | |
| payload: { field: string; value: string } | |
| ) => { |
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |