Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>rtksliceNew to Visual Studio Code? Get it now.
rtkslice

rtkslice

antocreadev

|
167 installs
| (1) | Free
Snippet for Redux ToolKit's slice (Typescript)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

rtkslice : Snippet for Redux ToolKit's slice (Typescript)

For use :

type rtkslice in typescript file and press enter

Screenshot of rtkslice

Example of snippet generated:

import { createSlice, PayloadAction } from '@reduxjs/toolkit';

export interface SliceNameState {
  property: type;
}

const initialState: SliceNameState = {
  property: initialValue,
};

export const SliceNameSlice = createSlice({
  name: 'SliceName',
  initialState,
  reducers: {
    reducerName: (state, action: PayloadAction<actionType>) => {
      state.property = action.payload;
    },
  },
});

export const { reducerName } = SliceNameSlice.actions;

export default SliceNameSlice.reducer;
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft