chore: merge branch 'master' into v2-exp

This commit is contained in:
Ayman Bagabas
2024-10-21 14:16:22 -04:00
18 changed files with 140 additions and 88 deletions
+3 -10
View File
@@ -1,7 +1,7 @@
package spinner
import (
"sync"
"sync/atomic"
"time"
tea "github.com/charmbracelet/bubbletea/v2"
@@ -10,17 +10,10 @@ import (
// Internal ID management. Used during animating to ensure that frame messages
// are received only by spinner components that sent them.
var (
lastID int
idMtx sync.Mutex
)
var lastID int64
// Return the next ID we should use on the Model.
func nextID() int {
idMtx.Lock()
defer idMtx.Unlock()
lastID++
return lastID
return int(atomic.AddInt64(&lastID, 1))
}
// Spinner is a set of frames used in animating the spinner.