Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. class StopwatchFormula : Formula<Unit, StopwatchFormula.State, StopwatchRenderModel> {
  2. // We will use this a little later.
  3. object State
  4.  
  5. override fun initialState(input: Unit): State = State
  6.  
  7. override fun evaluate(
  8. input: Unit,
  9. state: State,
  10. context: FormulaContext<State>
  11. ): Evaluation<StopwatchRenderModel> {
  12. return Evaluation(
  13. renderModel = StopwatchRenderModel(
  14. timePassed = "5s 10",
  15. startStopButton = ButtonRenderModel(
  16. text = "Start",
  17. onSelected = { /* TODO */ }
  18. ),
  19. resetButton = ButtonRenderModel(
  20. text = "Reset",
  21. onSelected = { /* TODO */ }
  22. )
  23. )
  24. )
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement