Skip to content

Instantly share code, notes, and snippets.

@guillaumefalvet
Created May 27, 2025 12:59
Show Gist options
  • Select an option

  • Save guillaumefalvet/b1b751d32773314a96b0f475b6cbd7de to your computer and use it in GitHub Desktop.

Select an option

Save guillaumefalvet/b1b751d32773314a96b0f475b6cbd7de to your computer and use it in GitHub Desktop.
ts snipet
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"life cycle declaration": {
"prefix": "lc",
"body": [
"// -- LIFECYCLE -- //"
],
"description": "Lifecycle declaration"
},
"public declaration": {
"prefix": "pub",
"body": [
"// -- PUBLIC -- //"
],
"description": "Public declaration"
},
"private declaration": {
"prefix": "priv",
"body": [
"// -- PRIVATE -- //"
],
"description": "Private declaration"
},
"init subject": {
"prefix": "initsub",
"body": [
"/**",
" * Initialize the subjects",
" * @returns { void } void",
" */",
"private _initSubjects(): void {",
"\t$0",
"}"
],
"description": "Initialize a Subject"
},
"init ws": {
"prefix": "initws",
"body": [
"/**",
" * Initialize websocket connections",
" * @returns { void } void",
" */",
"private _initWs(): void {",
"\t$0",
"}"
],
"description": "Initialize a Web connection",
},
"init http": {
"prefix": "inithttp",
"body": [
"/**",
" * Initialize http connections",
" * @returns { void } void",
" */",
"private _initHttp(): void {",
"\t$0",
"}"
],
"description": "Initialize an HTTP connection",
},
"init ts": {
"prefix": "initts",
"body": [
"/**",
" * Initialize the transfer state",
" * @returns { void } void",
" */",
"private _initTS(): void {",
"\t$0",
"}"
],
"description": "Initialize the transfer state",
},
"init sub": {
"prefix": "initsub",
"body": [
"/**",
" * Initialize the subscriptions",
" * @returns { void } void",
" */",
"private _initSubscriptions(): void {",
"\t$0",
"}"
],
"description": "Initialize the subscriptions",
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment