Hi Rupert
Thanks for that, here's where I ended up, not properly tested yet:
setTokenCheck : Model -> Cmd Msg
setTokenCheck model =
setTimeCheck model.theTime
(Auth.tokenExpiryTime model.authenticationModel)
TokenCheck
setTimeCheck : Time -> Time -> Msg -> Cmd Msg
setTimeCheck theTime expiryTime msg =
let
duration =
Basics.max 0 (expiryTime - theTime)
in
Time.now
|> Task.andThen (\now -> Process.sleep duration)
|> Task.attempt (\_ -> msg)
Can you tell me what this code is in your code:
delay refreshDate now =
max 0 ((Date.toTime refreshDate) - now)
What sort of thing is delay, a function or a variable?
--
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.