Created
March 7, 2023 01:25
-
-
Save budiadiono/60a062091e828c4bf57b11ae745d2d60 to your computer and use it in GitHub Desktop.
This file contains 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
Show hidden characters
{ | |
"Redux Slice": { | |
"scope": "typescript", | |
"prefix": "rdxslc", | |
"body": [ | |
"import { createSlice, PayloadAction } from '@reduxjs/toolkit';", | |
"", | |
"export interface ${1:${TM_FILENAME_BASE/(.*)(\\.slice$)/${1:/pascalcase}/g}}State {", | |
"\t$0", | |
"}", | |
"", | |
"const initialState: ${1}State = {}", | |
"", | |
"export const ${2:${TM_FILENAME_BASE/(.*)(\\.slice$)/${1:/camelcase}/g}}Slice = createSlice({", | |
"\tname: '${2}',", | |
"\tinitialState,", | |
"\treducers:{},", | |
"})", | |
"", | |
"export const ${2}Reducer = ${2}Slice.reducer;", | |
"export const {} = ${2}Slice.actions;" | |
], | |
"description": "Create redux slice" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment