Re: [elm-discuss] Localstorage data migration

2016-11-08 Thread Jacky
Thanks guys. I'm now using Json.Decode.Value and build a very forgiving decoder on top of it and it seems good enough for now. Will consider versioning schema if I need more control on that. On Wed, Nov 9, 2016 at 1:14 AM, Kasey Speakman wrote: > I would additionally make

[elm-discuss] Re: Correct use of port subscriptions in a submodule reused multiple times?

2016-11-08 Thread Wouter In t Velt
In your design, the port has a 1-to-1 connection to the Part. The port does not communicate for which Part the incoming message is intended, because it "expects" that their is only 1 Part. Your batch function in the subscriptions in the Group.elm passes on the port message on to all your Parts.

Re: [elm-discuss] How do you test a TEA `update` function?

2016-11-08 Thread Francesco Orsenigo
Ok, but is it justified to make your code more complicated just to enable testing? -- 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

[elm-discuss] Promises

2016-11-08 Thread Chris Van Vranken
I am trying to call GetUserMedia with the MediaStream API, which requires the use of Promises. Is there a good way to work with promises in Elm at this point? Can it be done with Task or Process API? Or should this piece of my code be done entirely in Javascript? Thanks. -- You received

Re: [elm-discuss] How do I subscribe to an event at a fixed point in time?

2016-11-08 Thread Max Goldstein
Could you run Time.now andThen calculate the amount of time left until expiry, then Process.sleep until then? -- 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

[elm-discuss] Re: Correct use of port subscriptions in a submodule reused multiple times?

2016-11-08 Thread OvermindDL1
That is expected. Generally you'd have a uniquely named port per module unless they really do all need to get the message. It might be better if you describe what you are trying to accomplish instead of how to accomplish it? :-) On Tuesday, November 8, 2016 at 10:19:37 AM UTC-7, Matthieu

Re: [elm-discuss] How do I subscribe to an event at a fixed point in time?

2016-11-08 Thread Witold Szczerba
You could propably "tick" (as in example from docs) every few seconds and return Cmd.none if you're before expiration, and some other Cmd otherwise. Does it make sense? Regards, Witold Szczerba 08.11.2016 5:22 PM "'Rupert Smith' via Elm Discuss" < elm-discuss@googlegroups.com> napisaƂ(a): > I

Re: [elm-discuss] Proposal: Add Debug.breakpoint to core

2016-11-08 Thread jedwards8
As someone casually observing Elm development, I'm very surprised by this; does Elm really make your life so easy you've never needed to set breakpoints and step through your code? It's hard for me to imagine writing a large-scale app without having to do that from time to time. On Saturday,

[elm-discuss] Correct use of port subscriptions in a submodule reused multiple times?

2016-11-08 Thread Matthieu Pizenberg
Hi, I am currently struggling with port subscriptions in a submodule (`Part`) reused multiple times in a bigger (`Group`) module like: -- In Group.elm type alias Model = { parts : Array Part.Model } I've been using the following "batching" technique (here are the relevant parts of 3 files:

Re: [elm-discuss] Localstorage data migration

2016-11-08 Thread Kasey Speakman
I would additionally make each migration function only go from one version to the next version up. Then chain them together up to the latest version. That way you only have to make 1 migration function for each version bump and leave the others untouched and still upgrade from any previous

[elm-discuss] Re: How do I subscribe to an event at a fixed point in time?

2016-11-08 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, November 8, 2016 at 5:00:54 PM UTC, Rupert Smith wrote: > > On Tuesday, November 8, 2016 at 4:22:08 PM UTC, Rupert Smith wrote: >> >> subscriptions : Model -> Sub Msg >> subscriptions model = >> if afterCloseToExpiryTime then >>Time.every Time.second RefreshTokenMsg >> else >>

[elm-discuss] Re: How do I subscribe to an event at a fixed point in time?

2016-11-08 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, November 8, 2016 at 4:22:08 PM UTC, Rupert Smith wrote: > > subscriptions : Model -> Sub Msg > subscriptions model = > if afterCloseToExpiryTime then >Time.every Time.second RefreshTokenMsg > else >Sub.none > I'm also struggling to get my head around how to implement

[elm-discuss] How do I subscribe to an event at a fixed point in time?

2016-11-08 Thread 'Rupert Smith' via Elm Discuss
I have an authentication token that I know expires at a particular moment in time: type alias AuthState = { loggedIn : Bool , permissions : List String , expiresAt : Maybe Date } I would like to fire an event once it gets close to 'expiresAt'. What happens if I update the