asobi_timer (asobi v0.35.4)

View Source

Summary

Types

timer/0

-opaque timer()

timer_event/0

-type timer_event() ::
          {timer_started, binary()} |
          {timer_warning, binary(), pos_integer()} |
          {timer_expired, binary()} |
          {phase_changed, binary(), binary()} |
          {window_open, binary()} |
          {window_close, binary()} |
          {scheduled_fire, binary()}.

Functions

conditional(Config)

-spec conditional(map()) -> timer().

countdown(Config)

-spec countdown(map()) -> timer().

current_phase(_)

-spec current_phase(timer()) -> binary() | undefined.

cycle(Config)

-spec cycle(map()) -> timer().

info(_)

-spec info(timer()) -> map().

is_expired(_)

-spec is_expired(timer()) -> boolean().

is_paused(_)

-spec is_paused(timer()) -> boolean().

is_started(Timer)

-spec is_started(timer()) -> boolean().

notify(Event, Data, Timer)

-spec notify(atom(), term(), timer()) -> {[timer_event()], timer()}.

pause(Timer)

-spec pause(timer()) -> timer().

remaining(_)

-spec remaining(timer()) -> number() | infinity.

resume(Timer)

-spec resume(timer()) -> timer().

scheduled(Config)

-spec scheduled(map()) -> timer().

tick(DeltaMs, Timer)

-spec tick(pos_integer(), timer()) -> {[timer_event()], timer()}.