Constructs a ReducedValue instance, which combines a value schema and a reducer function (plus optional input schema).
constructor<
Value = unknown,
Input = Value
>(
valueSchema: SerializableSchema<unknown, Value>,
init: ReducedValueInitWithSchema<Value, Input>
): ReducedValue<Value, Input>| Name | Type | Description |
|---|---|---|
valueSchema* | SerializableSchema<unknown, Value> | The schema that describes the type of value stored in state (the "running total"). |
init* | ReducedValueInitWithSchema<Value, Input> | An object specifying the reducer function (required), inputSchema (optional), and jsonSchemaExtra (optional). |