Re: [elm-discuss] Cannot call HTTP GET on an API that requires basic authentication

2016-08-24 Thread Peter Damoc
Could it be that you've run into an issue like the one described bellow ? https://williambert.online/2013/06/allow-cors-with-localhost-in-chrome/ On Thu, Aug 25, 2016 at 5:45 AM, Bryan Murphy wrote: > I'm having trouble calling Http.send on an API that requires basic >

[elm-discuss] Cannot call HTTP GET on an API that requires basic authentication

2016-08-24 Thread Bryan Murphy
I'm having trouble calling Http.send on an API that requires basic authentication. I collapsed the key part down into a single function: httpGet : JsonDecode.Decoder value -> String -> String -> Task.Task Http.Error value httpGet decoder authorization url = let request = { verb = "GET"

[elm-discuss] Re: Old browsers

2016-08-24 Thread Tim Stewart
Don't get me started on IT departments that mandate the use of old, buggy, insecure browsers that no longer have vendor support across their organisations! If their users get hit with browser-based attacks that compromise customer data the org could be liable.

Re: [elm-discuss] Re: Task ports: A proposal to make it easier to integrate JS with Elm.

2016-08-24 Thread Tim Stewart
Maybe it could accept either a promise or a (callback) function and behave accordingly? Anyone targeting IE could then decide whether to use callbacks or add a shim. On Thursday, August 25, 2016 at 7:46:55 AM UTC+10, James Wilson wrote: > > Good point, I had node in the back of my mind but

[elm-discuss] Re: How do I fire a Cmd once a page has been routed to?

2016-08-24 Thread Gabe Krambs
That certainly got me on the right track. Thanks again. On Wednesday, August 24, 2016 at 1:44:20 PM UTC-5, Gabe Krambs wrote: > > Good question. Will play and come back. Thanks! > > On Wednesday, August 24, 2016 at 1:36:06 PM UTC-5, OvermindDL1 wrote: >> >> If the data is not available at `init`

Re: [elm-discuss] Re: Composability without extensible records

2016-08-24 Thread Richard Feldman
Awesome! Best of luck with it! <3 On Wed, Aug 24, 2016 at 1:43 PM Charles-Edouard Cady < charlesedouardc...@gmail.com> wrote: > Thanks a lot, Richard, it makes much more sense now! > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Elm Discuss"

Re: [elm-discuss] Re: Task ports: A proposal to make it easier to integrate JS with Elm.

2016-08-24 Thread James
Good point, I had node in the back of my mind but somehow forgot what they did! On 24 Aug 2016 10:45 p.m., "Maxwell Gurewitz" wrote: > It'd be more in line with community standards if the callback followed the > node convention > > App.ports.myTaskFunc = function(val, cb)

[elm-discuss] Re: Task ports: A proposal to make it easier to integrate JS with Elm.

2016-08-24 Thread Maxwell Gurewitz
It'd be more in line with community standards if the callback followed the node convention App.ports.myTaskFunc = function(val, cb) { cb(null, val + 2); } On Wednesday, August 24, 2016 at 11:57:04 AM UTC-7, James Wilson wrote: > > It wouldn't be hard to provide a promise shim, although

[elm-discuss] Re: Old browsers

2016-08-24 Thread Max Froumentin
It's really about finding what browsers elm code won't run on. On the project I'm working on, IE8 is in scope because we still have a significant number of users using it. If I want to introduce elm, it's easier to say it runs without a problem than to say some features won't work, or we need

[elm-discuss] Re: Composability without extensible records

2016-08-24 Thread Charles-Edouard Cady
Thanks a lot, Richard, it makes much more sense now! -- 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+unsubscr...@googlegroups.com. For more options,

[elm-discuss] Re: Task ports: A proposal to make it easier to integrate JS with Elm.

2016-08-24 Thread James Wilson
It wouldn't be hard to provide a promise shim, although I'm not sure how I feel about that. Callbacks would be the well supported option, although the interface to promises maps better. Promises can only resolve/reject once, always return something, and the function attached to the task port

[elm-discuss] Re: How do I fire a Cmd once a page has been routed to?

2016-08-24 Thread Gabe Krambs
Good question. Will play and come back. Thanks! On Wednesday, August 24, 2016 at 1:36:06 PM UTC-5, OvermindDL1 wrote: > > If the data is not available at `init` then when is it available and why > are you unable to send a command on 'that' event? > > > On Wednesday, August 24, 2016 at 10:01:18

[elm-discuss] Re: So how do *you* handle Dates through ports?

2016-08-24 Thread OvermindDL1
It would be nice if 'Date' was a valid port type, where the date object is just created by passing whatever-it-is into a javascript `Date(thing)` constructor before being converted to Elm. That would cover the significant majority of Dates-Through-Ports cases. Custom port converters would

[elm-discuss] Re: Composability without extensible records

2016-08-24 Thread Richard Feldman
typo: should have written "i.e.its return type needs to be Html msg instead of Html Msg" -- 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: Old browsers

2016-08-24 Thread OvermindDL1
It works fine at least in IE11 and Edge, of which my app is tested in and works without issue. Do you not mean just old versions like IE8 and older (which need to die)? Or what about 9 and 10 as well? On Wednesday, August 24, 2016 at 10:38:39 AM UTC-6, Rex van der Spuy wrote: > > Just wish to

[elm-discuss] Re: Composability without extensible records

2016-08-24 Thread Richard Feldman
> > While I understand that not breaking things up too often is sound advice > in elm, I still think this doesn't answer my question Here is concretely what I'd do: type alias Model = { routes : List Route , hovered : Maybe Int , selected : Maybe Int , map : Map.InternalModel ,

[elm-discuss] Re: How do I fire a Cmd once a page has been routed to?

2016-08-24 Thread OvermindDL1
If the data is not available at `init` then when is it available and why are you unable to send a command on 'that' event? On Wednesday, August 24, 2016 at 10:01:18 AM UTC-6, Gabe Krambs wrote: > > I have an SPA that has a page that includes a chart. I'm using a JS port > to activate/send data

[elm-discuss] Re: Task ports: A proposal to make it easier to integrate JS with Elm.

2016-08-24 Thread Maxwell Gurewitz
My only comment would be that the interface should not rely on promises, which are not supported by IE. Instead it should use node style callbacks. On Saturday, August 13, 2016 at 8:31:07 AM UTC-7, James Wilson wrote: > > The problem > > ports as they stand are fundamentally incompatible with

[elm-discuss] Re: So how do *you* handle Dates through ports?

2016-08-24 Thread Kasey Speakman
Yeah, a number has specific advantages and disadvantages vs ISO date. Neither is strictly better, just different trade-offs. You mention decoding. To me it seems better to auto-decode, using two records if necessary, than to employ Json.decode. It's also conceptually more simple (record to

Re: [elm-discuss] Re: Old browsers

2016-08-24 Thread Nick H
Ah, well forget everything I said then. That sounds like it's worth opening a bug report for. On Wed, Aug 24, 2016 at 9:38 AM, Rex van der Spuy wrote: > Just wish to alert everyone that Elm's port code will not work with any > version of IE without a ployfill for

[elm-discuss] Re: Old browsers

2016-08-24 Thread Rex van der Spuy
Just wish to alert everyone that Elm's port code will not work with any version of IE without a ployfill for `Object.assign` (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -- You received this message because you are subscribed to the Google

[elm-discuss] Re: Composability without extensible records

2016-08-24 Thread Rex van der Spuy
> > Just break it into modules so your similar functions are grouped together > in files. Use them just like you already are. > The part I don't understand is: how do you create UI components that maintain their internal state without nesting them as child components? -- You received this

[elm-discuss] Re: Collecting use cases for File, ArrayBuffer and TypedArrays/DataViews

2016-08-24 Thread Erik Lott
Our primary application allows photographers to upload hundreds/thousands of images for portfolio display. image delivery, etc. I guess you could say that our app is generally driven by image uploads. I would love to see this functionality provided by Elm, rather than having to use ports... On

[elm-discuss] How do I fire a Cmd once a page has been routed to?

2016-08-24 Thread Gabe Krambs
I have an SPA that has a page that includes a chart. I'm using a JS port to activate/send data to a chart.js chart. When the page is loaded, I'd like to send the chart data via the port. I'm able to wire the commands up fine on events (like a select change, for example), but am at a loss for

[elm-discuss] Re: Composability without extensible records

2016-08-24 Thread Josh Adams
Just break it into modules so your similar functions are grouped together in files. Use them just like you already are. We did a bit of this here: https://www.dailydrip.com/blog/elm-pair-programming-josh-adams-and-luke-westby-pairing-on-colluder On Tuesday, August 23, 2016 at 11:29:31 PM