mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
14 lines
344 B
Go
14 lines
344 B
Go
package presentation
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
)
|
|
|
|
// Loader dumps a string to be displayed as a loader
|
|
func Loader(now time.Time, config config.SpinnerConfig) string {
|
|
milliseconds := now.UnixMilli()
|
|
index := milliseconds / int64(config.Rate) % int64(len(config.Frames))
|
|
return config.Frames[index]
|
|
}
|