See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
import { FC, useCallback } from "react"; | |
import { useGlobal, ACTIONS, GlobalContextProps } from "../contexts/global"; | |
export interface IGlobal extends GlobalContextProps { | |
requestHandler: (requestFunction: () => {}) => Promise<any>; | |
} | |
interface IWrappedComponent { | |
global: IGlobal; | |
} |
import { | |
createContext, | |
useReducer, | |
useMemo, | |
useContext, | |
ReactNode | |
} from "react"; | |
type ContextProps = { | |
isLoading: boolean; |
const api = axios.create({ | |
baseURL: "http://localhost:8080/", | |
}); | |
api.interceptors.response.use( | |
(response) => response.data, | |
(error) => Promise.reject(error) | |
); | |
export const useRequest = (config) => { |
// implementation with Array | |
const fibo = len => | |
new Array(len).fill(1).reduce((acc, _, index) => { | |
const value = | |
index === 0 || index === 1 | |
? index | |
: acc[acc.length - 2] + acc[acc.length - 1]; | |
acc.push(value); | |
return acc; | |
}, []); |
// obj literals with javascript | |
const actions = { | |
'sayHello': name => `hello my friend ${name}`, | |
'typeOf': value => typeof value, | |
'onlyString': 'simple string', | |
'default': null | |
} | |
const reducer = (action, payload) => { |
async function asyncForEach(array, callback) { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array); | |
} | |
} | |
const waitFor = ms => new Promise(r => setTimeout(r, ms)); | |
asyncForEach([1, 2, 3], async num => { | |
await waitFor(50); |
module.exports = { | |
env: { | |
es6: true, | |
node: true, | |
jest: true | |
}, | |
extends: ['airbnb-base', 'prettier'], | |
plugins: ['prettier'], | |
globals: { | |
Atomics: 'readonly', |
const { GraphQLObjectType, GraphQLList, GraphQLSchema, GraphQLInt, GraphQLString, GraphQLBoolean } = require('graphql') | |
const axios = require('axios') | |
// Launch Type | |
const LaunchType = new GraphQLObjectType({ | |
name: 'Launch', | |
fields: () => ({ | |
flight_number: { type: GraphQLInt }, | |
mission_name: { type: GraphQLString }, | |
launch_year: { type: GraphQLString }, | |
launch_date_local: { type: GraphQLString }, |
{ | |
"javascript.updateImportsOnFileMove.enabled": "always", | |
"files.exclude": { | |
"**/.git": true, | |
"**/.svn": true, | |
"**/.hg": true, | |
"**/CVS": true, | |
"**/.DS_Store": true | |
}, | |
"search.exclude": { |