# `LedgerUI.Timer`
[🔗](https://github.com/devaction-labs/ledger_ui/blob/v0.2.0/lib/ledger_ui/components/timer.ex#L201)

Commands for a `<.timer>` (see `LedgerUI.Components.Timer`).

In the browser, with no round trip (`phx-click`):

    phx-click={LedgerUI.Timer.pause("shift")}
    phx-click={LedgerUI.Timer.resume("shift")}
    phx-click={LedgerUI.Timer.toggle("shift")}
    phx-click={LedgerUI.Timer.add("shift", 900)}

From the server: `LedgerUI.Timer.add(socket, "shift", 900)`, `pause/2`, `resume/2`, `toggle/2`.
`add` takes time away with a negative number.

# `add`

Browser command: adds `seconds` to the elapsed time of the timer `id`.

# `add`

Server command: adds `seconds` to the elapsed time of the timer `id`.

# `pause`

Browser command: pause the timer `id`.

# `pause`

Server command: pause the timer `id`.

# `resume`

Browser command: resume the timer `id`.

# `resume`

Server command: resume the timer `id`.

# `toggle`

Browser command: toggle the timer `id`.

# `toggle`

Server command: toggle the timer `id`.

---

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