Last active
June 28, 2024 12:49
-
-
Save raphaeldealmeida/4b0b84ae082fc28b66a7b69f2647d133 to your computer and use it in GitHub Desktop.
Mithril VS Code snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Mithril snippets | |
// Paste in File > Preferences > Configure User Snippets > typescriptreact.json | |
// ref: https://code.visualstudio.com/docs/editor/userdefinedsnippets | |
"Mithril component": { | |
"prefix": ["mcomp"], | |
"body": [ | |
"import m from \"mithril\"", | |
"", | |
"interface T${1:MyComponent}Props {}", | |
"const $1: m.ClosureComponent<T$1Props> = () => {", | |
"", | |
" return {", | |
" view: () => {", | |
" return <>", | |
" $1", | |
" </>", | |
" }", | |
" }", | |
"}", | |
"", | |
"export default $1", | |
], | |
"description": "A component Mithril" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok.