Home

Reducers

Reducers are devices or functions designed to reduce a physical quantity or to transform a state. In engineering, a gear reducer or gearbox lowers rotational speed while increasing torque. In software, a reducer is a pure function that computes a new application state from the current state and an action. Both uses share the goal of controlled transformation, with different implementations and constraints.

A mechanical reducer consists of gears in a housing and typically two or more shafts: an input

Software reducers are pure functions used in unidirectional data flow architectures, notably Redux. A reducer takes

shaft
driven
by
a
motor
and
a
slower,
higher-torque
output
shaft.
The
gear
ratio,
the
proportion
of
teeth
between
gears,
determines
how
many
input
revolutions
produce
one
output
revolution.
Higher
ratios
yield
greater
speed
reduction
and
torque
multiplication,
but
increase
size,
cost,
and
losses.
Common
configurations
include
parallel
shaft
(spur
or
helical),
bevel,
worm,
and
planetary
gear
trains.
Design
factors
include
maximum
torque,
allowable
backlash,
efficiency,
lubrication,
cooling,
and
mounting
arrangement.
Proper
selection
matches
load
characteristics
and
duty
cycle
to
achieve
reliable,
smooth
operation.
a
current
state
and
an
action
object
and
returns
a
new
state
without
modifying
the
old
one.
They
are
typically
defined
with
a
switch
or
mapping
over
action
types
and
must
be
deterministic
and
side-effect
free.
Immutability
is
a
common
pattern,
with
updates
expressed
as
new
objects
or
copies.
Reducers
enable
predictable
state
management,
easier
testing,
and
features
like
time-travel
debugging
and
undo/redo.
They
are
used
to
manage
UI
state,
data
stores,
and
application
configuration,
and
can
compose
with
other
reducers
to
form
a
larger
state
tree.