Skip to content

Commit

Permalink
docs: added code snippets (QwikDev#3674)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-r3aper7 authored Apr 5, 2023
1 parent 2e378ba commit 0e6ddc4
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .vscode/qwik.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
"$0"
]
},
"Qwik signal": {
"scope": "javascriptreact,typescriptreact",
"prefix": "q:useSignal",
"description": "useSignal() declaration",
"body": [
"const ${1:signal} = useSignal($2);",
"$0"
]
},
"$ hook": {
"scope": "javascriptreact,typescriptreact",
"prefix": "q:$",
Expand Down Expand Up @@ -82,5 +91,44 @@
"});",
""
]
},
"useOn": {
"scope": "javascriptreact,typescriptreact",
"prefix": "q:useOn",
"description": "useOn declaration",
"body": [
"useOn(",
"'$1',",
"$((event) => {",
" const { $3 } = event as $2;",
" })",
");"
]
},
"useOnDocument": {
"scope": "javascriptreact,typescriptreact",
"prefix": "q:useOnDocument",
"description": "useOnDocument declaration",
"body": [
"useOnDocument(",
"'$1',",
"$((event) => {",
" const { $3 } = event as $2;",
" })",
");"
]
},
"useOnWindow": {
"scope": "javascriptreact,typescriptreact",
"prefix": "q:useOnWindow",
"description": "useOnWindow declaration",
"body": [
"useOnWindow(",
"'$1',",
"$((event) => {",
" const { $3 } = event as $2;",
" })",
");"
]
}
}

0 comments on commit 0e6ddc4

Please sign in to comment.