[elm-discuss] Re: Http Requests with authentication

2016-05-27 Thread Gage Peterson
Basically this is just a matter of modeling the problem using model, update, and subscriptions. You oculd save a request queue in your model and toggle something to retry grabbing tokens. Once you receive one just have that initiate the next one on the queue. There's no real way in Elm to hide

Re: [elm-discuss] Setting Focus of form inputs

2016-05-27 Thread Nick H
I think that attribute only works for focusing on a page load, not for firing some arbitrary .focus() event. But it's the only Elm-based way I could find. On Fri, May 27, 2016 at 3:24 PM, Nick H wrote: > > http://package.elm-lang.org/packages/elm-lang/html/1.0.0/Html-Attributes#autofocus > > On

Re: [elm-discuss] Setting Focus of form inputs

2016-05-27 Thread Nick H
http://package.elm-lang.org/packages/elm-lang/html/1.0.0/Html-Attributes#autofocus On Fri, May 27, 2016 at 3:06 PM, Matt Woodyard wrote: > Is there a elm based way to set the focus of a node or are ports the way > to do this still? > > matt > > -- > You received this message because you are subs

[elm-discuss] Setting Focus of form inputs

2016-05-27 Thread Matt Woodyard
Is there a elm based way to set the focus of a node or are ports the way to do this still? matt -- 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+unsu

Re: [elm-discuss] Re: Best practice for hover

2016-05-27 Thread John Watson
Excellent. Thanks very much for all your help. On 27 May 2016 at 21:44, Alexandre Galays wrote: > In that case, you're better of just using the :hover selector in CSS. > > > On Friday, May 27, 2016 at 10:15:22 PM UTC+2, John Watson wrote: >> >> Nothing fancy - just basic styling of colour, opaci

[elm-discuss] Re: Best practice for hover

2016-05-27 Thread Alexandre Galays
In that case, you're better of just using the :hover selector in CSS. On Friday, May 27, 2016 at 10:15:22 PM UTC+2, John Watson wrote: > > Nothing fancy - just basic styling of colour, opacity etc. > > On Friday, 27 May 2016 20:01:13 UTC+1, VeryThorough wrote: >> >> What do you want to happen on h

Re: [elm-discuss] elm-stuff causing troubles after each updates

2016-05-27 Thread Nick H
What exactly do you mean by "breaks my elm-stuff directory?" Are you getting a specific error message when you do elm package install or elm make? On Fri, May 27, 2016 at 1:08 PM, TheGryzor123 wrote: > I'm working on automating the "elm package install" command as part of my > deployment process

[elm-discuss] Re: Best practice for hover

2016-05-27 Thread John Watson
Nothing fancy - just basic styling of colour, opacity etc. On Friday, 27 May 2016 20:01:13 UTC+1, VeryThorough wrote: > > What do you want to happen on hover? If you can give some details, I can > probably tell you how to do it in CSS. > > On Friday, May 27, 2016 at 3:46:06 AM UTC-7, John Watson

[elm-discuss] elm-stuff causing troubles after each updates

2016-05-27 Thread TheGryzor123
I'm working on automating the "elm package install" command as part of my deployment process. I noticed that each time there is a new update in the packages it then breaks my elm-stuff directory. I have to systematically remove it and reinstall all the packages to get my app working again. Am

Re: [elm-discuss] Re: Import module from src directory in elm-repl

2016-05-27 Thread Nick H
Three questions: 1. What happens if you run rm -rf elm-stuff/build-artifacts And then try elm-repl again? 2. Would you mind sharing your entire elm-package.json? 3. Is 0.17 the only version of Elm you have installed? I wasn't able to reproduce your problem, so I am just trying to get more inf

[elm-discuss] Re: Best practice for hover

2016-05-27 Thread VeryThorough
What do you want to happen on hover? If you can give some details, I can probably tell you how to do it in CSS. On Friday, May 27, 2016 at 3:46:06 AM UTC-7, John Watson wrote: > > If I have a bunch of buttons that all need to respond to mouseOver 'hover' > in the same way, what's the best pract

[elm-discuss] Re: Best practice for hover

2016-05-27 Thread Alexandre Galays
If CSS transitions are too limited (they often are :( ), Gage Peterson is right about having to put that "state" in your model, there really isn't any alternative in Elm (apart from delegating to some JS code to do it instead but that lowers the maintenance fun) Just wanted to correct one thing

[elm-discuss] Re: Best practice for hover

2016-05-27 Thread Gage Peterson
This may not be a satisfactory answer but you could just do it with CSS animations. Doing it in elm requires that the state reside somewhere in the model. There's no "state" part like in React (now considered mostly a bad practice even in that community). On Friday, May 27, 2016 at 4:46:06 AM

Re: [elm-discuss] Why can the source code for the Html module not use a type variable after Html?

2016-05-27 Thread Janis Voigtländer
What you can do if you really want, and in some parts of your code only have, nodes that come without event handlers, is this: type alias StaticHtml = Html Never tableCell : a -> StaticHtmltableCell data = td [] [text (toString data)] If eventually you need to embed this into views that do hav

Re: [elm-discuss] Why can the source code for the Html module not use a type variable after Html?

2016-05-27 Thread Ray Toal
Yes, thanks, right there on the top of the my screen is the old evancz/elm-html. I should have paid more attention. Okay, found elm-lang/elm-html. I knew it moved...going to have to stop using Google as my entry into the documentation, as it will take the search giant a while to make the top se

Re: [elm-discuss] Why can the source code for the Html module not use a type variable after Html?

2016-05-27 Thread Janis Voigtländer
You are looking at outdated documentation. That's all. The current documentation of td has the type variable. > Am 27.05.2016 um 17:42 schrieb Ray Toal : > > Hi > > I wanted to write > > tableCell : a -> Html > tableCell data = > td [] [text (toString data)] > > but I got an error so I had

[elm-discuss] Why can the source code for the Html module not use a type variable after Html?

2016-05-27 Thread Ray Toal
Hi I wanted to write tableCell : a -> Html tableCell data = td [] [text (toString data)] but I got an error so I had to write tableCell : a -> Html b tableCell data = td [] [text (toString data)] This makes sense because in the REPL we see > td : List (Html.Attribute a) -> List (Html.

Re: [elm-discuss] Re: how to stop subscription?

2016-05-27 Thread Gage Peterson
Wow! I didn't know that. On Fri, May 27, 2016 at 2:37 AM James Wilson wrote: > Correct: Every time the global update function in your app runs for any > reason, the global subscriptions object is reevaluated as well, and effect > managers receive the new list of current subscriptions. > > -- > Y

Re: [elm-discuss] proof of concept share/import feature for elm-lang.org/try

2016-05-27 Thread Matteo Bertini
Yes, I've had the same idea, using the history only has no back-end maintenance burden, "only" a front-end will-work-now-on implicit contract. Going on with the UI, I have added 2 more buttons in the command bar: - Import that reads from the location.hash - Share that puts the code encodeURICompo

Re: [elm-discuss] Re: unexpected behavior when double nesting modules

2016-05-27 Thread Janis Voigtländer
Thanks to @Iznaak! > Am 27.05.2016 um 16:01 schrieb John Askew : > > Yes, updating to elm-lang/virtual-dom to 1.0.2 has fixed my issue. > > https://github.com/elm-lang/virtual-dom/pull/20/files > > Thanks! > John > >> On Friday, May 27, 2016 at 2:03:01 AM UTC-4, Janis Voigtländer wrote: >> It’

[elm-discuss] Http Requests with authentication

2016-05-27 Thread Maximilian Hoffmann
Hey there! What is a good way to handle http request authentication with the elm architecture? I need to get data from an API that requires a valid token for every request. Tokens expire after X minutes and should be refreshed, if a request fails with an authentication error. When the first re

Re: [elm-discuss] Re: unexpected behavior when double nesting modules

2016-05-27 Thread John Askew
Yes, updating to elm-lang/virtual-dom to 1.0.2 has fixed my issue. https://github.com/elm-lang/virtual-dom/pull/20/files Thanks! John On Friday, May 27, 2016 at 2:03:01 AM UTC-4, Janis Voigtländer wrote: > > It’s probably fixed by 1.0.2 of elm-lang/virtual-dom now. > ​ > > 2016-05-26 17:24 GMT+0

Re: [elm-discuss] proof of concept share/import feature for elm-lang.org/try

2016-05-27 Thread Paul Brauner
Evan's comment on the issue sounds as if he thinks the code has to be stored serverside or something. Otherwise I'm not sure where the maintenance burden he's referring to lies. Paul On Fri, May 27, 2016 at 10:20 AM Matteo Bertini wrote: > Il giorno giovedì 26 maggio 2016 19:55:26 UTC+2, Nick H

[elm-discuss] Re: Import module from src directory in elm-repl

2016-05-27 Thread Shump
My elm-package.json has the following entry: ... "source-directories": [ "src" ], ... and my directory looks like this (minus elm-stuff folder in the root) . ├── build │ └── MyModule.js ├── elm-package.json ├── index.html └── src └── MyModule.elm and I try to launch

[elm-discuss] Re: How can I do module level configuration?

2016-05-27 Thread Fernando Alegre
A pattern I have used sometimes is to have the context passed as a list instead of a record: type Options = OptA | OptB Float | OptC Color -- A call with default options: view [] model -- A call with custom options: view [OptA, OptC red] model Actually, now that I think of it, that is how eve

[elm-discuss] Best practice for hover

2016-05-27 Thread John Watson
If I have a bunch of buttons that all need to respond to mouseOver 'hover' in the same way, what's the best practice for implementing this in elm? I have so far looked at mdgriffith/elm-style-animation. This seems fine although I wondered if using this for such simple behaviour was overkill.

[elm-discuss] Re: Elm 0.16 access

2016-05-27 Thread Alexey Shamrin
> So, while I'm mostly interested in seeing 0.17 get fleshed out, I think > having a link on the front page of elm-lang.org that would take one back > to the 0.16 world would be a good thing while 0.17 matures. > By the way, Elm 0.16 world lives at http://elm-lang.org:1234

[elm-discuss] Re: Announcing elm-lang/navigation for "routing in single-page apps"

2016-05-27 Thread Emilien Taque
Migrated my main app to Navigation, reusing my route parser. Painless migration, works as expected, can still do proper transitions. Thumbs up! Le jeudi 26 mai 2016 00:02:03 UTC+2, Evan a écrit : > > On Friday, Noah and I worked on "updating elm-history" so that folks can > do "routing" with Elm

Re: [elm-discuss] Re: how to stop subscription?

2016-05-27 Thread James Wilson
Correct: Every time the global update function in your app runs for any reason, the global subscriptions object is reevaluated as well, and effect managers receive the new list of current subscriptions. -- You received this message because you are subscribed to the Google Groups "Elm Discuss"

Re: [elm-discuss] interesting article

2016-05-27 Thread James Wilson
Other bits I learned from chatting to Jean were - SAM decouples the code that decides what effects to produce from the message. This would basically mean splitting the update function into two parts; update the model first, and then inspect the new model only to decide which effect to run. - SA

Re: [elm-discuss] proof of concept share/import feature for elm-lang.org/try

2016-05-27 Thread Matteo Bertini
Il giorno giovedì 26 maggio 2016 19:55:26 UTC+2, Nick H ha scritto: > > Sounds like you should check out (and maybe contribute to) ElmFiddle.io! > I'd like to have this basic functionality in the official "try" too, but I'll have a look at ElmFiddle.io ! -- You received this message because you