I believe that every functions that receive a model are reevaluated when 
the model changes.

On Friday, 27 May 2016 07:36:09 UTC+1, 大魔头 wrote:
>
> I add a "shouldStop: Bool" flag to the model. and check it in subscription 
> definition:
>
> subscriptions : Model -> Sub Msg
>> subscriptions model =
>>   if model.shouldStop then
>>     Sub.none
>>   else
>>     Time.every second Tick
>
>
> It works!  but this confuse me. 
> doesn't this mean,whenever model is changed, the subscription is 
> reevaluated?
>
> On Fri, May 27, 2016 at 2:11 PM, Gage Peterson <[email protected] 
> <javascript:>> wrote:
>
>> I'm not sure it's possible at this point. One way would be to simply 
>> ignore them based on some state in the model. Like a boolean called 
>> "trackTime" that would only react to the time if it was true. 
>>
>>
>> On Thursday, May 26, 2016 at 8:53:08 PM UTC-6, 大魔头 wrote:
>>>
>>> hi,
>>>
>>> in the guide http://guide.elm-lang.org/architecture/effects/time.html
>>> there is an exercise:
>>>
>>> Exercises:
>>>
>>>    - Add a button to pause the clock, turning the Time subscription off.
>>>
>>> but I search the api doc, and didn't find out how to do this? any hints?
>>>
>> -- 
>> 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 [email protected] <javascript:>.
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to