File: loader.go

package info (click to toggle)
lazygit 0.57.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,748 kB
  • sloc: sh: 153; makefile: 76
file content (14 lines) | stat: -rw-r--r-- 344 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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]
}