mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Subs shouldn't take a model as an argument
This also nullifies the need for SubMap
This commit is contained in:
@@ -55,7 +55,7 @@ func update(message tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) {
|
||||
|
||||
func subscriptions(_ tea.Model) tea.Subs {
|
||||
return tea.Subs{
|
||||
"tick": func(_ tea.Model) tea.Msg {
|
||||
"tick": func() tea.Msg {
|
||||
time.Sleep(time.Second)
|
||||
return tickMsg{}
|
||||
},
|
||||
|
||||
@@ -59,7 +59,7 @@ func view(model tea.Model) string {
|
||||
// second, sends a tick, and then restarts.
|
||||
func subscriptions(_ tea.Model) tea.Subs {
|
||||
return tea.Subs{
|
||||
"tick": func(_ tea.Model) tea.Msg {
|
||||
"tick": func() tea.Msg {
|
||||
time.Sleep(time.Second)
|
||||
return TickMsg{}
|
||||
},
|
||||
|
||||
@@ -58,12 +58,12 @@ func subscriptions(model tea.Model) tea.Subs {
|
||||
}
|
||||
}
|
||||
|
||||
func tick(model tea.Model) tea.Msg {
|
||||
func tick() tea.Msg {
|
||||
time.Sleep(time.Second)
|
||||
return tickMsg{}
|
||||
}
|
||||
|
||||
func frame(model tea.Model) tea.Msg {
|
||||
func frame() tea.Msg {
|
||||
time.Sleep(time.Second / 60)
|
||||
return frameMsg{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user