# `BB.Robot.ParamResolver`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/robot/param_resolver.ex#L5)

Resolves parameter references in robot structs.

When a robot's DSL uses `param([:path, :to, :param])` instead of literal unit
values, the Builder stores `nil` for those fields and records subscriptions
in `param_subscriptions`. This module handles:

1. **Initial resolution** - At startup, resolve all param refs using current
   parameter values
2. **Dynamic updates** - When a parameter changes, update all affected fields
   in the robot struct

# `resolve_all`

```elixir
@spec resolve_all(BB.Robot.t(), BB.Robot.State.t()) :: BB.Robot.t()
```

Resolve all parameter references in a robot struct.

Iterates through `robot.param_subscriptions` and resolves each parameter
reference using the current value from `robot_state`.

Returns the updated robot struct with all param refs resolved to values.

# `update_for_param`

```elixir
@spec update_for_param(BB.Robot.t(), [atom()], term(), BB.Robot.State.t()) ::
  BB.Robot.t()
```

Update all fields that reference a specific parameter.

When a parameter changes, this function updates all robot struct fields
that reference that parameter path.

Returns the updated robot struct.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
