[elm-discuss] Re: Google Places and Elm / Identifying when Elm is mounted

2017-04-03 Thread Fikse
Thanks Christian. That does work. Now I'm attempting to translate this into an application using react-elm-components. I am already using Html.programWithFlags for passing in flags, and I can pass in ports using this method as well. I am now faced with the same problem where it is unclear when

[elm-discuss] Re: Noticeable lag when working with a model that contains large dataset

2017-04-03 Thread David Legard
Might it also be quicker to put the Parent -> Child link in the Child element? That way you avoid Lists in your definition type alias Parent = { id: Int , title: String } type alias Child = { id: Int , title: String , ancestor: Parent } A further step could be to

[elm-discuss] Re: Google Places and Elm / Identifying when Elm is mounted

2017-04-03 Thread Christian Charukiewicz
I think what you want to do here is load your compiled Elm js script followed by your googleapis script. One way to do this would be to use jQuery's getScript() function (or a vanilla JS equivalent of it ) to sequence the order of the loading. With jQuery

[elm-discuss] Re: Flags vs Ports

2017-04-03 Thread Christian Charukiewicz
This is correct. I think you listed the primary use cases that each interface serves, but I would say ports goes beyond just data. I can provide a few examples of how we use both. Our Elm application is embedded into several pages of a much older and larger CakePHP application (CakePHP is a

[elm-discuss] Google Places and Elm / Identifying when Elm is mounted

2017-04-03 Thread Fikse
Is there a way to tell if Elm is mounted in the DOM? I am attempting to use Google Places with ports. The Google Places code is trying to attach to an HTML element generated by Elm, but it doesn't exist on the page. My code is at https://ellie-app.com/Pzg2NLX7W5a1/3 and the error can be found

[elm-discuss] Re: Noticeable lag when working with a model that contains large dataset

2017-04-03 Thread Jais Cheema
I saw that behaviour too but I think thats understandable because it would have to render the data in the debugger window in a new node. I was seeing pretty bad performance so that was the first thing I turned off  On Tuesday, April 4, 2017 at 3:31:24 AM UTC+10, Ian Mackenzie wrote: > > Is the

Re: [elm-discuss] Noticeable lag when working with a model that contains large dataset

2017-04-03 Thread Jais Cheema
Thanks for that Aaron, Html.Lazy fixed it. I had never used that until now but that seems very useful utility  I did do the iteration check and made sure that the form wasn't affecting the list but was thinking along the lines that every update would have to recreate the model record, with

[elm-discuss] Re: Noticeable lag when working with a model that contains large dataset

2017-04-03 Thread Ian Mackenzie
Is the issue specific to when running in debug mode (when using Elm Reactor or compiling with --debug), by any chance? I recently encountered an issue where the debugger will scan through the entire model after every update, which is quite slow if there are large data structures in the model. I

Re: [elm-discuss] Noticeable lag when working with a model that contains large dataset

2017-04-03 Thread Aaron VonderHaar
Hi! The first thing I'd check is whether your view or update functions end up doing O(n) operations (like iteration) with the large list. (Perhaps searching through it for some reason to do validation as the form changes? If that's the problem, then you'll want to consider alternate data

[elm-discuss] Re: ANN: TypedSvg

2017-04-03 Thread 'Rupert Smith' via Elm Discuss
On Friday, March 31, 2017 at 3:40:23 PM UTC+1, Noah Gordon wrote: > > elm-lang/svg does not provide any strong typing for its functions; it's a > direct exposure of SVG's API, and all of its functions take strings as > arguments. An incorrectly-formatted string will not break your application >

[elm-discuss] Re: Checking JWT Token expiry and Time

2017-04-03 Thread 'Rupert Smith' via Elm Discuss
On Sunday, April 2, 2017 at 4:44:29 AM UTC+1, Richard Wood wrote: > > Hi All > > I'm working on a base application involving authentication, Auth0 and AWS > access. There's a lot of useful starter scripts and examples around - hats > off to the community - so I'm basically pulling stuff together

Re: [elm-discuss] Flags vs Ports

2017-04-03 Thread Aaron VonderHaar
Ahoy! :) Yes, everything you've said is correct, including avoiding unnecessary maybes. On Sun, Apr 2, 2017 at 11:41 PM, Richard Wood wrote: > Sounds like some nautical adventure! > > When is it appropriate to bring in data through flags vs through using > ports. > At the

[elm-discuss] Flags vs Ports

2017-04-03 Thread Richard Wood
Sounds like some nautical adventure! When is it appropriate to bring in data through flags vs through using ports. At the moment I'm thinking: Flags: * When needed immediately on initialisation * When it won't change Ports: * Dynamic data * Data not available at the start Is another reason