Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class StopwatchFormula : Formula<Unit, StopwatchFormula.State, StopwatchRenderModel> {
- // We will use this a little later.
- object State
- override fun initialState(input: Unit): State = State
- override fun evaluate(
- input: Unit,
- state: State,
- context: FormulaContext<State>
- ): Evaluation<StopwatchRenderModel> {
- return Evaluation(
- renderModel = StopwatchRenderModel(
- timePassed = "5s 10",
- startStopButton = ButtonRenderModel(
- text = "Start",
- onSelected = { /* TODO */ }
- ),
- resetButton = ButtonRenderModel(
- text = "Reset",
- onSelected = { /* TODO */ }
- )
- )
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement