John Bugner
2017-07-17 13:03:03 UTC
The signature of program.subs (from
http://package.elm-lang.org/packages/elm-lang/core/5.1.1/Platform ) is:
'model -> Sub msg'.
Why isn't it just 'Sub msg' ? What's the point of including the model in
there? Sure, it lets you control what subscriptions you listen too
depending on the current model, but what's the benefit of that? Is it wise
to rely on this function to control what messages you receive? The update
function still has to have a case for every message no matter the state,
after all. Is there some performance improvement from using this that I'm
not aware of?
http://package.elm-lang.org/packages/elm-lang/core/5.1.1/Platform ) is:
'model -> Sub msg'.
Why isn't it just 'Sub msg' ? What's the point of including the model in
there? Sure, it lets you control what subscriptions you listen too
depending on the current model, but what's the benefit of that? Is it wise
to rely on this function to control what messages you receive? The update
function still has to have a case for every message no matter the state,
after all. Is there some performance improvement from using this that I'm
not aware of?
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.