pawanpoudel / beginning-elm-code

Code examples from the Beginning Elm book - https://elmprogramming.com/
108 stars 19 forks source link

Provide an example of conditional subscription. #6

Open pdamoc opened 3 years ago

pdamoc commented 3 years ago

It would be wonderful to have an example of a subscription that depends on the state of the model as this aspect is not currently covered by The Guide and it might be useful to people starting up.

Here is an example of such a conditional approach.

Alternatively, it can be just mentioned that the subscription is generated on each model update.