forked from Mirrors/bubbletea
Use consts for default values
This commit is contained in:
parent
cd4e02b1a8
commit
bb85a886fd
@ -16,6 +16,10 @@ const (
|
||||
Dot
|
||||
)
|
||||
|
||||
const (
|
||||
defaultFPS = 9
|
||||
)
|
||||
|
||||
var (
|
||||
// Spinner frames
|
||||
spinners = map[Spinner][]string{
|
||||
@ -61,7 +65,7 @@ type Model struct {
|
||||
func NewModel() Model {
|
||||
return Model{
|
||||
Type: Line,
|
||||
FPS: 9,
|
||||
FPS: defaultFPS,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,10 @@ import (
|
||||
"github.com/muesli/termenv"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultBlinkSpeed = time.Millisecond * 600
|
||||
)
|
||||
|
||||
var (
|
||||
// color is a helper for returning colors
|
||||
color func(s string) termenv.Color = termenv.ColorProfile().Color
|
||||
@ -160,7 +164,7 @@ type BlinkMsg struct{}
|
||||
func NewModel() Model {
|
||||
return Model{
|
||||
Prompt: "> ",
|
||||
BlinkSpeed: time.Millisecond * 600,
|
||||
BlinkSpeed: defaultBlinkSpeed,
|
||||
Placeholder: "",
|
||||
TextColor: "",
|
||||
PlaceholderColor: "240",
|
||||
|
Loading…
Reference in New Issue
Block a user