How would I use createSlice()? The createSlice() function is used to simplify and reduce the code needed when creating application slices. It takes an object of options as an argument. The options are: name : the slice name used as the prefix of the generated action.