mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-25 07:04:37 +03:00
Add spinner.Model.Tick method, deprecate spinner.Tick method.
This commit is contained in:
parent
94b84b6120
commit
e83c113d06
@ -254,8 +254,12 @@ func (m Model) View() string {
|
|||||||
|
|
||||||
// Tick is the command used to advance the spinner one frame. Use this command
|
// Tick is the command used to advance the spinner one frame. Use this command
|
||||||
// to effectively start the spinner.
|
// to effectively start the spinner.
|
||||||
func Tick() tea.Msg {
|
func (m Model) Tick() tea.Msg {
|
||||||
return TickMsg{Time: time.Now()}
|
return TickMsg{
|
||||||
|
Time: time.Now(),
|
||||||
|
id: m.id,
|
||||||
|
tag: m.tag,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Model) tick(id, tag int) tea.Cmd {
|
func (m Model) tick(id, tag int) tea.Cmd {
|
||||||
@ -267,3 +271,11 @@ func (m Model) tick(id, tag int) tea.Cmd {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tick is the command used to advance the spinner one frame. Use this command
|
||||||
|
// to effectively start the spinner.
|
||||||
|
//
|
||||||
|
// This method is deprecated. Use Model.Tick instead.
|
||||||
|
func Tick() tea.Msg {
|
||||||
|
return TickMsg{Time: time.Now()}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user