mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-14 00:38:37 -07:00
Remove entire subscription model
It was a valiant effort, and the implementation was solid and dependable, but at the end of the day we can achieve the same functionality in a much simpler fashion with commands, especially because Go is not held to the same restrictions as Elm.
This commit is contained in:
@@ -22,7 +22,6 @@ func main() {
|
||||
initialize,
|
||||
update,
|
||||
view,
|
||||
subscriptions,
|
||||
)
|
||||
|
||||
if err := p.Start(); err != nil {
|
||||
@@ -38,7 +37,7 @@ func initialize() (boba.Model, boba.Cmd) {
|
||||
return Model{
|
||||
textInput: inputModel,
|
||||
err: nil,
|
||||
}, nil
|
||||
}, input.Blink(inputModel)
|
||||
}
|
||||
|
||||
func update(msg boba.Msg, model boba.Model) (boba.Model, boba.Cmd) {
|
||||
@@ -74,20 +73,6 @@ func update(msg boba.Msg, model boba.Model) (boba.Model, boba.Cmd) {
|
||||
return m, cmd
|
||||
}
|
||||
|
||||
func subscriptions(model boba.Model) boba.Subs {
|
||||
m, ok := model.(Model)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
sub, err := input.MakeSub(m.textInput)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return boba.Subs{
|
||||
"input": sub,
|
||||
}
|
||||
}
|
||||
|
||||
func view(model boba.Model) string {
|
||||
m, ok := model.(Model)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user