Skip to content

Commit

Permalink
refactor: progress: return Model instead of tea.Model (#719)
Browse files Browse the repository at this point in the history
This conforms to the new generic bubbletea API.
See charmbracelet/bubbletea#1298
  • Loading branch information
aymanbagabas authored Jan 29, 2025
1 parent 421843b commit a0d9fe3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions progress/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ func New(opts ...Option) Model {
}

// Init exists to satisfy the tea.Model interface.
func (m Model) Init() (tea.Model, tea.Cmd) {
func (m Model) Init() (Model, tea.Cmd) {
return m, nil
}

// Update is used to animate the progress bar during transitions. Use
// SetPercent to create the command you'll need to trigger the animation.
//
// If you're rendering with ViewAs you won't need this.
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
switch msg := msg.(type) {
case FrameMsg:
if msg.id != m.id || msg.tag != m.tag {
Expand Down

0 comments on commit a0d9fe3

Please sign in to comment.