Redux Toolkit exports some of its internal utilities, and re-exports additional functions from other dependencies as well.
An inlined copy of
nanoid/nonsecure. Generates a non-cryptographically-secure random ID string.
createAsyncThunk uses this by default for request IDs. May also be useful for other cases as well.
A re-worked, inlined copy of
serialize-error. Serializes an error into a plain object.
createAsyncThunk uses this by default for rejected cases. May also be useful other other cases as well.
Returns a plain object with optional
current function from the
immer library, which takes a snapshot of the current state of a draft and finalizes it (but without freezing). Current is a great utility to print the current state during debugging, and the output of
current can also be safely leaked outside the producer.
combineReducers, re-exported for convenience. While
configureStore calls this internally, you may wish to call it yourself to compose multiple levels of slice reducers.
compose. It composes functions from right to left.
This is a functional programming utility. You might want to use it to apply several store custom enhancers/ functions in a row.
bindActionCreators. It wraps action creators with
dispatch() so that they dispatch immediately when called.
createStore. You should not need to use this directly.
applyMiddleware. You should not need to use this directly.