redux_toolkit library

Classes

ActionReducerMap<State>
Abstraction on top of the data structure used to build reducers with createReducer.
ActionReducerMapBuilder<State>
Interface used to build Reducers with createReducer.
AsyncThunk<Self, State, Payload, Result>
Abstraction to make thunks that just deal with a Future adhere to a standard.
Fulfilled<T, P, M>
Action that gets dispatched when an AsyncThunk finishes successfully.
Meta<T>
Metadata used by AsyncThunk
PayloadAction<Payload, Meta, Error>
Base abstract class to make your custom actions more uniform
Pending<T, M>
Action that gets dispatched when an AsyncThunk starts being processed.
Rejected<T, M, E>
Action that gets dispatched when an AsyncThunk finishes with an error.
StoreBuilder<State>
Interface used to build Store instances with createStore.

Functions

configureStore<State>(StoreBuilderCallback<State> builderCallback) Future<Store<State>>
A friendly abstraction over the standard way of instantiating the Store class. Build a store with redux_thunk and opt-in to redux_dev_tools and redux_remote_devtools.
createReducer<State>(State initialState, BuilderCallback<State> builderCallback) Reducer<State>
Abstraction that allows to create a reducer without writing tons of if statements one after the other.
createSelector1<S, R1, T>(Selector<S, R1> selector, T combiner(R1), {T Function(R1) memoize(T (R1))}) Selector<S, T>
Create a memoized selector starting with one selector. It will cache the result of the combiner function, and only recompute when the provided selector delivers new results.
createSelector10<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, Selector<S, R4> selector4, Selector<S, R5> selector5, Selector<S, R6> selector6, Selector<S, R7> selector7, Selector<S, R8> selector8, Selector<S, R9> selector9, Selector<S, R10> selector10, T combiner(R1, R2, R3, R4, R5, R6, R7, R8, R9, R10), {T Function(R1, R2, R3, R4, R5, R6, R7, R8, R9, R10) memoize(T (R1, R2, R3, R4, R5, R6, R7, R8, R9, R10))}) Selector<S, T>
Create a memoized selector by combining ten selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector2<S, R1, R2, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, T combiner(R1, R2), {T Function(R1, R2) memoize(T (R1, R2))}) Selector<S, T>
Create a memoized selector by combining two selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector3<S, R1, R2, R3, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, T combiner(R1, R2, R3), {T Function(R1, R2, R3) memoize(T (R1, R2, R3))}) Selector<S, T>
Create a memoized selector by combining three selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector4<S, R1, R2, R3, R4, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, Selector<S, R4> selector4, T combiner(R1, R2, R3, R4), {T Function(R1, R2, R3, R4) memoize(T (R1, R2, R3, R4))}) Selector<S, T>
Create a memoized selector by combining four selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector5<S, R1, R2, R3, R4, R5, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, Selector<S, R4> selector4, Selector<S, R5> selector5, T combiner(R1, R2, R3, R4, R5), {T Function(R1, R2, R3, R4, R5) memoize(T (R1, R2, R3, R4, R5))}) Selector<S, T>
Create a memoized selector by combining five selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector6<S, R1, R2, R3, R4, R5, R6, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, Selector<S, R4> selector4, Selector<S, R5> selector5, Selector<S, R6> selector6, T combiner(R1, R2, R3, R4, R5, R6), {T Function(R1, R2, R3, R4, R5, R6) memoize(T (R1, R2, R3, R4, R5, R6))}) Selector<S, T>
Create a memoized selector by combining six selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector7<S, R1, R2, R3, R4, R5, R6, R7, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, Selector<S, R4> selector4, Selector<S, R5> selector5, Selector<S, R6> selector6, Selector<S, R7> selector7, T combiner(R1, R2, R3, R4, R5, R6, R7), {T Function(R1, R2, R3, R4, R5, R6, R7) memoize(T (R1, R2, R3, R4, R5, R6, R7))}) Selector<S, T>
Create a memoized selector by combining seven selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector8<S, R1, R2, R3, R4, R5, R6, R7, R8, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, Selector<S, R4> selector4, Selector<S, R5> selector5, Selector<S, R6> selector6, Selector<S, R7> selector7, Selector<S, R8> selector8, T combiner(R1, R2, R3, R4, R5, R6, R7, R8), {T Function(R1, R2, R3, R4, R5, R6, R7, R8) memoize(T (R1, R2, R3, R4, R5, R6, R7, R8))}) Selector<S, T>
Create a memoized selector by combining eight selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
createSelector9<S, R1, R2, R3, R4, R5, R6, R7, R8, R9, T>(Selector<S, R1> selector1, Selector<S, R2> selector2, Selector<S, R3> selector3, Selector<S, R4> selector4, Selector<S, R5> selector5, Selector<S, R6> selector6, Selector<S, R7> selector7, Selector<S, R8> selector8, Selector<S, R9> selector9, T combiner(R1, R2, R3, R4, R5, R6, R7, R8, R9), {T Function(R1, R2, R3, R4, R5, R6, R7, R8, R9) memoize(T (R1, R2, R3, R4, R5, R6, R7, R8, R9))}) Selector<S, T>
Create a memoized selector by combining nine selectors. It will cache the result of the combiner function, and only recompute when the provided selectors deliver new results.
generate([int size = 21]) String
An inlined copy of nanoid/nonsecure. Generates a non-cryptographically-secure random ID string. Automatically used by createAsyncThunk for request IDs, but may also be useful for other cases as well.

Typedefs

ActionMatcher<Action> = bool Function(Action action)
Predicate that given an action returns true if the action matches a certain criteria.
BuilderCallback<State> = dynamic Function(ActionReducerMapBuilder<State> builder)
Type used for the callback passed to createReducer.
CaseReducer<State, Action> = State Function(State state, Action action)
A single case reducer - given a state and a particular action return the corresponding next state.
DefaultCaseReducer<State> = State Function(State state)
Default case reducer - given the state return the default next state.
Selector<S, T> = T Function(S state)
A Selector is a function that derives data from a single input, such as a the State of a Redux Store.
StoreBuilderCallback<State> = dynamic Function(StoreBuilder<State> builder)
Type used for the argument passed to configureStore.