# `Otera.State`
[🔗](https://github.com/georgeguimaraes/otera/blob/v0.1.0/lib/otera/state.ex#L1)

The mutable state of a render, for the Python objects that templates change: `namespace()` objects and the last value of `loop.changed()`.

Values are immutable in Elixir, so `run/1` keeps this state in the process dictionary for the length of a render, and restores the previous state after it, so that a render inside a custom filter does not see the state of the outer render.

# `get`

```elixir
@spec get(term(), term()) :: term()
```

Returns the value for `key`, or `default`.

# `put`

```elixir
@spec put(term(), term()) :: :ok
```

Sets the value for `key`.

# `run`

```elixir
@spec run((-&gt; result)) :: result when result: term()
```

Runs `fun` with an empty state.

---

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