|
1224 | 1224 | "description": "Zustand useStore with shallow",
|
1225 | 1225 | "scope": "javascript,typescript,javascriptreact,typescriptreact"
|
1226 | 1226 | },
|
| 1227 | + "🟨 rxUseDispatch": { |
| 1228 | + "prefix": "rxDispatch.$rxDispatch.useDispatch", |
| 1229 | + "body": [ |
| 1230 | + "const dispatch = useDispatch$1()", |
| 1231 | + "" |
| 1232 | + ], |
| 1233 | + "description": "Redux useDispatch", |
| 1234 | + "scope": "javascript,typescript,javascriptreact,typescriptreact" |
| 1235 | + }, |
| 1236 | + "🟨 rxConfigStore": { |
| 1237 | + "prefix": "rxStore.$rxStore.configureStore", |
| 1238 | + "body": [ |
| 1239 | + "import { configureStore } from '@reduxjs/toolkit'", |
| 1240 | + "", |
| 1241 | + "const ${1:store} = configureStore({", |
| 1242 | + "\treducer: {", |
| 1243 | + "\t\t$2", |
| 1244 | + "\t},", |
| 1245 | + "})", |
| 1246 | + "", |
| 1247 | + "export default $1" |
| 1248 | + ], |
| 1249 | + "description": "Redux configureStore", |
| 1250 | + "scope": "javascript,typescript,javascriptreact,typescriptreact" |
| 1251 | + }, |
| 1252 | + "🟨 rxCreateSlice": { |
| 1253 | + "prefix": "rxSlice.$rxSlice.createSlice", |
| 1254 | + "body": [ |
| 1255 | + "const initialState = {", |
| 1256 | + "\t${2:value: 0,}", |
| 1257 | + "}", |
| 1258 | + "", |
| 1259 | + "export const ${1:counter}Slice = createSlice({", |
| 1260 | + "\tname: '$1',", |
| 1261 | + "\tinitialState,", |
| 1262 | + "\treducers: {", |
| 1263 | + "\t\t$3", |
| 1264 | + "\t},", |
| 1265 | + "})", |
| 1266 | + "", |
| 1267 | + "export const { $0 } = $1Slice.actions", |
| 1268 | + "", |
| 1269 | + "export default $1Slice.reducer" |
| 1270 | + ], |
| 1271 | + "description": "Redux createSlice", |
| 1272 | + "scope": "javascript,typescript,javascriptreact,typescriptreact" |
| 1273 | + }, |
| 1274 | + "🟨 rxCreateSliceWithExample": { |
| 1275 | + "prefix": "rxSlice.$rxSlice.createSliceWithExample", |
| 1276 | + "body": [ |
| 1277 | + "const initialState = {", |
| 1278 | + "\t${2:value: 0,}", |
| 1279 | + "}", |
| 1280 | + "", |
| 1281 | + "export const ${1:counter}Slice = createSlice({", |
| 1282 | + "\tname: '$1',", |
| 1283 | + "\tinitialState,", |
| 1284 | + "\treducers: {", |
| 1285 | + "\t\t$3increment: (state) => {", |
| 1286 | + "\t\t\tstate.value += 1", |
| 1287 | + "\t\t},", |
| 1288 | + "\t\tdecrement: (state) => {", |
| 1289 | + "\t\t\tstate.value -= 1", |
| 1290 | + "\t\t},", |
| 1291 | + "\t\tincrementByAmount: (state, action) => {", |
| 1292 | + "\t\t\tstate.value += action.payload", |
| 1293 | + "\t\t},", |
| 1294 | + "\t},", |
| 1295 | + "})", |
| 1296 | + "", |
| 1297 | + "export const { increment, decrement, incrementByAmount } = $1Slice.actions", |
| 1298 | + "", |
| 1299 | + "export default $1Slice.reducer" |
| 1300 | + ], |
| 1301 | + "description": "Redux createSlice (with example)", |
| 1302 | + "scope": "javascript,typescript,javascriptreact,typescriptreact" |
| 1303 | + }, |
| 1304 | + "🟦 TS RxConfigStore": { |
| 1305 | + "prefix": "rxStore.TS.$$rxStore.configureStore", |
| 1306 | + "body": [ |
| 1307 | + "import { configureStore } from '@reduxjs/toolkit'", |
| 1308 | + "", |
| 1309 | + "const ${1:store} = configureStore({", |
| 1310 | + "\treducer: {", |
| 1311 | + "\t\t$2", |
| 1312 | + "\t},", |
| 1313 | + "})", |
| 1314 | + "", |
| 1315 | + "export default $1", |
| 1316 | + "", |
| 1317 | + "export type RootState = ReturnType<typeof $1.getState>", |
| 1318 | + "", |
| 1319 | + "export type AppDispatch = typeof $1.dispatch" |
| 1320 | + ], |
| 1321 | + "description": "Redux configure store", |
| 1322 | + "scope": "javascript,typescript,javascriptreact,typescriptreact" |
| 1323 | + }, |
1227 | 1324 | "🟨 reactFnCompEmotion": {
|
1228 | 1325 | "prefix": "emoRFC.$emoRFC",
|
1229 | 1326 | "body": [
|
|
0 commit comments