redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

Allow providing custom slice creators when calling createSlice

Open EskiMojo14 opened this issue 1 year ago • 2 comments

const loaderSlice = createSlice({
  name: "loader",
  initialState: {} as Partial<Record<string, true>>,
  creators: { loader: loaderCreator },
  reducers: (create) => ({
    addLoader: create.loader({}),
  }),
});

EskiMojo14 avatar Apr 15 '24 16:04 EskiMojo14

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

codesandbox[bot] avatar Apr 15 '24 16:04 codesandbox[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c7c88f2cf58561032f738682348558a6390450e2:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

codesandbox-ci[bot] avatar Apr 15 '24 16:04 codesandbox-ci[bot]