- stopwatch on cafu framework
- cafu_core
- stopwatch
yarn add "umm/cafu_stopwatch#^1.0.0"
Implement IStopwatchPresenter on your presenter
public class SamplePresenter : IStopwatchPresenter { /* implement */ }
Now easy to refer stopwatch event.
var presenter = this.GetPresenter<IStopwatchPresenter>();
// start
presenter.StartStopwatch();
// stop
presenter.StopStopwatch();
// resume
presenter.ResumeStopwatch();
// pause
presenter.PauseStopwatch();
// time observing
presenter.GetTimeAsObservable().Subscribe(time => this.Text.text = $"{time} seconds");
// stop observing
presenter.GetStoppedTimeAsObservable().Subscribe(time => this.Text.text = $"{time} seconds");
Copyright (c) 2018 Takuma Maruyama
Released under the MIT license, see LICENSE.txt