# tmux_matcher:prepare/2

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

```
-callback prepare(State :: term(),
                  Snapshot :: tmux_snapshot:t()) ->
                     {ok,
                      fun((tmux_model:row()) ->
                              boolean())} |
                     {error, term()}.
```

Prepare a local Boolean predicate once for this captured snapshot. Return a tagged preparation error when the matcher cannot operate. Callback exceptions remain application failures; this does not make a matcher portable or suitable for untrusted module selection.

## Parameters

- `State` (`term()`)
- `Snapshot` (`tmux_snapshot:t()`)
