Closed Chillance closed 7 years ago
Hi @Chillance In this case you need to add a timer by ui.Merge("timer", ui.NewTimerCh(100*time. Millisecond))
. This will add a 100ms
timer into the underlying event system. The 1s
timer just added by default for the sake of convenience.
Wouldn't it be cool if it was possible to specify the timer that way I mentioned above? With your suggestion, it works, but this will set the same timeout for all timers, right?
That is actually a good idea! Parse the event string and add the timer accordingly, so that there is no need to add it by invoking ui.Merge
.
And yes, if without explicitly using a different EvtStream, all events will share one DefaultEvtStream, then all events will be piped into it.
Will you create a feature request for it here on github so I can track it?
I thought when I saw:
ui.Handle("/timer/1s", func(e ui.Event) {...}
you could modify to something like:
ui.Handle("/timer/100ms", func(e ui.Event) {...}
to get 100ms delays for it to be called, but doesn't seem to work. Am I missing something?Thanks!