# `TuningFork.Store`
[🔗](https://github.com/jaman/tuning_fork/blob/v0.1.11/tuning_fork/lib/tuning_fork/store.ex#L1)

The ETS tables holding `TuningFork.Tick` counters and time-stamped `TuningFork.State` values.

# `as`

```elixir
@spec as(term(), non_neg_integer(), (-&gt; result)) :: result when result: term()
```

Run `fun` as `name`'s body, playing at frame `at`.

`TuningFork.Tick.tick/0` then counts on `name`'s own counter, and `TuningFork.State.set/2`
and `get/2` read and write at `at`.

# `at`

```elixir
@spec at() :: non_neg_integer()
```

The frame the body being run is playing at, or `0` outside one.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `clear`

```elixir
@spec clear() :: :ok
```

Empty both tables.

# `clear_ticks`

```elixir
@spec clear_ticks() :: :ok
```

Empty the counters.

# `clear_values`

```elixir
@spec clear_values() :: :ok
```

Empty the values.

# `fetch`

```elixir
@spec fetch(term(), non_neg_integer(), term()) :: term()
```

The newest value stored under `key` at or before frame `at`, or `default`. A value set
later than `at` is not seen.

# `keys`

```elixir
@spec keys(non_neg_integer()) :: [term()]
```

Every key that has a value at or before frame `at`.

# `loop`

```elixir
@spec loop() :: term() | nil
```

The loop whose body is being run, or `nil` outside one.

# `peek`

```elixir
@spec peek(term()) :: non_neg_integer()
```

A counter's value without stepping it.

# `put`

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

Store `value` under `key` as of frame `at`.

# `put_tick`

```elixir
@spec put_tick(term(), non_neg_integer()) :: :ok
```

Set a counter.

# `step`

```elixir
@spec step(term()) :: non_neg_integer()
```

Step a counter on and give what it was.

---

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