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.
Summary
Functions
Browser command: adds seconds to the elapsed time of the timer id.
Server command: adds seconds to the elapsed time of the timer id.
Browser command: pause the timer id.
Server command: pause the timer id.
Browser command: resume the timer id.
Server command: resume the timer id.
Browser command: toggle the timer id.
Server command: toggle the timer id.
Functions
Browser command: adds seconds to the elapsed time of the timer id.
Server command: adds seconds to the elapsed time of the timer id.
Browser command: pause the timer id.
Server command: pause the timer id.
Browser command: resume the timer id.
Server command: resume the timer id.
Browser command: toggle the timer id.
Server command: toggle the timer id.