コード例 #1
0
        public void Countdown(int seconds, Action action)
        {
            var secondsRemaining = Observables.Countdown(seconds);

            Subscribe(secondsRemaining, EventBus.Publish);

            var timedOut = secondsRemaining.Where(s => s.secondsRemaining == 0).Select(s => new Unit());
            var spaceBar = EventBus.Receive <ProceedToNextPhase>().Select(s => new Unit());

            Subscribe(
                timedOut.Merge(spaceBar),
                action
                );
        }