3 ms·
> How to make it better? that's easy. IT ALREADY EXISTS and is part of Elm. It's just a private API. But it totally does work. It's how the native wrappers are
by bbcbasic 10y ago
> How to make it better? that's easy. IT ALREADY EXISTS and is part of Elm. It's just a private API. But it totally does work. It's how the native wrappers are written.
You mean like this: https://github.com/mcapodici/capodicis-notes/blob/master/elmsrc/Native/ExtensionStorage.js https://github.com/mcapodici/capodicis-notes/blob/master/elm...
That is an example where I connected chrome extension storage functionality using native wrappers.
This is the Elm wrapping for it:
https://github.com/mcapodici/capodicis-notes/blob/master/elmsrc/ExtensionStorage.elm https://github.com/mcapodici/capodicis-notes/blob/master/elm...
- efficax 10y agoThe Native interop changed with core >= 4.0, so that relatively straightforward way of accessing native js no longer works, and the new Native is (deliberately, I believe) undocumented.
- bbcbasic 10y agoThat's Elm's weakness then. The goalposts keep moving.
- knewter 10y agoIn a pre-1.0 language, this should be entirely expected. It's bleeding edge a bit, but I've yet to find someone who used it to build something non-trivial and wasn't sold on it. There's definitely some survivor bias there, obviously. For the record, I looked at Elm over 2 years ago and completely dismissed it. I regret that strongly now as I am extreeeeemely happy developing with it and I can build stuff in far shorter timelines with zero runtime errors than I could in react even (which was a high-watermark before Elm for me in that respect)