Last active
October 15, 2017 20:11
-
-
Save rymndhng/f7517f2d8ec1da97adb6f0f2553869d3 to your computer and use it in GitHub Desktop.
See that `${1:$(string-inflection-upcase-function yas-text)}` is used 4 times.
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
# -*- mode: snippet -*- | |
# name: action | |
# key: act | |
# expand-env: ((yas-indent-line 'fixed)) | |
# Depends on string-inflection package | |
# -- | |
export const ${1:$(string-inflection-upcase-function yas-text)} = '${1:$(string-inflection-upcase-function yas-text)}' | |
type ${1:$$(string-inflection-camelcase-function yas-text)}Payload = { | |
$0 | |
} | |
export type $1 = $Action<typeof ${1:$(string-inflection-upcase-function yas-text)}, $1Payload> | |
export const ${1:$(string-inflection-lower-camelcase-function yas-text)} = (payload: $1Payload) => { | |
return { | |
payload, | |
type: ${1:$(string-inflection-upcase-function yas-text)} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment