Re: [elm-discuss] Re: Why is the signature of 'program.subs' 'model -> Sub msg' ?

2017-07-21 Thread Mark Hamburg
My understanding is that yes, Elm does this with every update and then the effects managers have to look at the new subscriptions and compare them to the old subscriptions. I would love to hear that my understanding is wrong because while this isn't bad if you have just a few subscriptions, it

Re: [elm-discuss] Re: Why is the signature of 'program.subs' 'model -> Sub msg' ?

2017-07-21 Thread Vasily Vasilkov
Does it mean that Elm runtime creates and cancels subscriptions on the fly (for  every model change)? On Mon, Jul 17, 2017 at 6:19 PM +0400, "Marek Fajkus" wrote: Sometimes you

[elm-discuss] Re: Why is the signature of 'program.subs' 'model -> Sub msg' ?

2017-07-17 Thread John Bugner
On Monday, July 17, 2017 at 9:19:00 AM UTC-5, Marek Fajkus wrote: > > Sometimes you don't need subscriptions if you're in some state. For > instance, if you have game and subscription to say mouse position you can > subscribe to Mouse.position only when a user is in play state and avoid >

Re: [elm-discuss] Re: Why is the signature of 'program.subs' 'model -> Sub msg' ?

2017-07-17 Thread Aaron VonderHaar
Another example is a package like WebSocket, where the package will open a network connection while you are subscribed and close it when you stop subscribing. On Jul 17, 2017 7:19 AM, "Marek Fajkus" wrote: Sometimes you don't need subscriptions if you're in some state. For

[elm-discuss] Re: Why is the signature of 'program.subs' 'model -> Sub msg' ?

2017-07-17 Thread Marek Fajkus
Sometimes you don't need subscriptions if you're in some state. For instance, if you have game and subscription to say mouse position you can subscribe to Mouse.position only when a user is in play state and avoid subscription in game menu. -- You received this message because you are

[elm-discuss] Re: Why is the signature of 'program.subs' 'model -> Sub msg' ?

2017-07-17 Thread art yerkes
Updates take CPU time, heat up your user's laptop, reinvigorate cold memory, often when your user is trying to use their computer for other things. If running some code won't be useful, you should avoid running it. It also saves the environment just a tiny amount. On Monday, July 17, 2017 at