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:
Christian Rocha
2020-05-12 17:56:30 -04:00
parent 82ddbb8e12
commit ade8203c21
13 changed files with 136 additions and 322 deletions

View File

@@ -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 {