dwyl / learn-elm

:rainbow: discover the beautiful programming language that makes front-end web apps a joy to build and maintain!
https://github.com/dwyl/learn-elm
483 stars 43 forks source link

http-gifs example declares a subscription function to always return Sub.none #77

Open njsfield opened 7 years ago

njsfield commented 7 years ago

Here in the http-gifs example, a subscriptions function is set up to always return Sub.none. It's a shame that in order to make use of the init function a user has to always deal with the subscriptions function too in Https program, perhaps in this example it would be better to use an anonymous function in the initial program declaration;

   , subscriptions = \_ -> Sub.none

To avoid additional code. Or alternatively

   , subscriptions = always Sub.none

To avoid the anonymous function pattern. Always is a bit more readable, and could perhaps be used here.