# tmux_filter:prepare/2

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_filter.erl#L178
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_filter-prepare-2/

```
prepare/2
-spec prepare(t(), tmux_snapshot:t()) ->
                 {ok, prepared()} | {error, map()}.
```

Bind a filter to one snapshot and check all required coverage first.

The prepared value can match only unmodified rows captured in that snapshot.
It remains usable after the endpoint closes. It cannot refresh observations.

## Examples

```erlang
1> {ok, F} = tmux_filter:new(pane, #{width => #{gte => 80}}), ok.
ok
2> tmux_filter:requirements(F).
[{collection,pane},{field,pane,width}]
```

## Parameters

- `Filter` (`t()`)
- `Snapshot` (`tmux_snapshot:t()`)
