NestedReducerBuilder<State extends Built<State, StateBuilder> , StateBuilder extends Builder<State, StateBuilder> , NestedState extends Built<NestedState, NestedStateBuilder> , NestedStateBuilder extends Builder<NestedState, NestedStateBuilder> > class
NestedReducerBuilder allows you to build a reducer that rebuilds built values nested within your main app state model. For example, consider the following built value
abstract class BaseState implements Built<BaseState, BaseStateBuilder> {
NestedBuiltValue get nestedBuiltValue;
// Built value constructor
BaseState._();
factory BaseState() => new _$BaseState._(
count: 1,
nestedBuiltValue: new NestedBuiltValue(),
);
}
A NestedReducerBuilder can be used to map certain actions to reducer functions that only rebuild nestedBuiltValue
Two mapper functions are required by the constructor to map the state and state builder objects to the nested value and nested builder.
_stateMapper
maps the state built to the nested built, in this case:
(BaseCounter state) => state.nestedBuiltValue
_builderMapper
maps the state builder to the nested builder, in this case:
(BaseCounterBuilder stateBuilder) => stateBuilder.nestedBuiltValue
Constructors
-
NestedReducerBuilder(Mapper<
State, NestedState> _stateMapper, Mapper<StateBuilder, NestedStateBuilder> _builderMapper)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add<
Payload> (ActionName< Payload> actionName, Reducer<NestedState, NestedStateBuilder, Payload> reducer) → void -
Registers
reducer
function to the givenactionName
-
combineReducerBuilder(
ReducerBuilder< NestedState, NestedStateBuilder> other) → void -
combineReducerBuilder takes a
ReducerBuilder
with the type argumentsNestedState
,NestedStateBuilder
, and combines it with thisNestedReducerBuilder
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited