Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

umm/cafu_stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cafu_stopwatch

What

  • stopwatch on cafu framework

Requirement

  • cafu_core
  • stopwatch

Install

yarn add "umm/cafu_stopwatch#^1.0.0"

Usage

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");

License

Copyright (c) 2018 Takuma Maruyama

Released under the MIT license, see LICENSE.txt