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