Skip to content

Instantly share code, notes, and snippets.

@xavierartot
Created January 19, 2018 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavierartot/656fc00cbe55957c7034dc50366a9d79 to your computer and use it in GitHub Desktop.
Save xavierartot/656fc00cbe55957c7034dc50366a9d79 to your computer and use it in GitHub Desktop.
snippet const
const ${1} = ${0};
snippet let
let ${1} = ${0};
snippet im "import xyz from 'xyz'"
import ${1} from '${2:$1}';
snippet imas "import * as xyz from 'xyz'"
import * as ${1} from '${2:$1}';
snippet imm "import { member } from 'xyz'"
import { ${1} } from '${2}';
snippet cla
class ${1} {
${0:${VISUAL}}
}
snippet clax
class ${1} extends ${2} {
${0:${VISUAL}}
}
snippet clac
class ${1} {
constructor(${2}) {
${0}
}
}
snippet foro "for (const prop of object}) { ... }"
for (const ${1:prop} of ${2:object}) {
${0:$1}
}
# Generator
snippet fun*
function* ${1:function_name}(${2}) {
${0}
}
snippet c=>
const ${1:function_name} = (${2}) => {
${0}
}
snippet l=>
let ${1:function_name} = (${2}) => {
${0}
}
snippet caf
const ${1:function_name} = (${2}) => {
${0}
}
snippet =>(
(${1}) => {
${0}
}
snippet =>{
(${1}) => {
${0}
}
snippet =>i
${1} => ${0}
snippet af
(${1}) => {
${0}
}
snippet afi
${1} => ${0}
snippet sym
const ${1} = Symbol('${0}');
snippet ed
export default ${0}
snippet $
${${1}}${0}
snippet map
${1}.map( (element) => {
return element${0}
});
snippet filter
${1}.filter( (element) => {
element${0}
});
snippet sort
${1}.sort( (element => ) {
element${0}
});
snippet reduce
${1}.reduce((previousVal, currentVal) => {
previousVal + currentVal${0}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment