Re: [elm-discuss] Unexpected Time.every drift over time

2017-06-05 Thread RGBboy
On Safari/node setInterval does indeed exhibit the same issue so this is not a bug in Elms core. However Elm does have an opportunity to smooth this inconsistency out. What I have done so far to mitigate this issue is essentially what you describe. I have experimented with a couple of different

[elm-discuss] Unexpected Time.every drift over time

2017-06-04 Thread RGBboy
I have been using Time.every for a project that requires ticks at a constant interval. I found that different platforms drift by varying amounts. Some platforms seem to oscillate around the desired 0 millisecond drift. This is acceptable for my use case. However some platforms constantly increa

[elm-discuss] Re: Pure Elm contenteditable rich text editor

2016-10-12 Thread RGBboy
You should read this article to see why existing solutions generally do not work very well: https://medium.engineering/why-contenteditable-is-terrible-122d8a40e480 I am pretty sure draft.js has a good underlying data model that copes with mapping to the DOM well. Perhaps looking into how that w

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

2016-08-15 Thread RGBboy
I have just been thinking the exact same thing over the past couple of days. If you wanted to keep compatibility with older browsers this could also just be a function that takes a value and a node style callback: Elm.Main.ports.apiSession = function (value, cb) { var sess = localStorage.get