Deprecate NewModel() constructors; use New() instead

This commit is contained in:
Christian Rocha
2022-01-10 18:27:33 -05:00
parent 9401ebbb83
commit b35f96cd2d
6 changed files with 41 additions and 11 deletions

View File

@@ -193,14 +193,19 @@ func (m Model) Visible() bool {
return !m.hidden() && !m.finished()
}
// NewModel returns a model with default values.
func NewModel() Model {
// New returns a model with default values.
func New() Model {
return Model{
Spinner: Line,
id: nextID(),
}
}
// NewModel returns a model with default values.
//
// Deprecated. Use New instead.
var NewModel = New
// TickMsg indicates that the timer has ticked and we should render a frame.
type TickMsg struct {
Time time.Time