Because primitives rock. If we expose API primitives in a typesafe way, we allow the community to use them to create useful libraries.
I actually see that the persistent cache package has a LocalStorage module which exposes a subset of my proposed API. However, It does not implement the storage event which allows for easy synching across open tabs/windows. It also does not implement any bindings for sessionStorage. On Oct 31, 2016 8:40 AM, "Joe Clay" <[email protected]> wrote: > I think it ties in with the general theme of Elm trying to guide you into > making the right choices - if there's no real use case for LocalStorage > other than using it as a cache, why expose the low level bindings and allow > people to shoot themselves in the foot with them? > > On Monday, October 31, 2016 at 7:22:44 AM UTC, David Andrews wrote: >> >> Thanks for pointing me to that, and the Justification section therein >> answers my next question. However, I don't see why it makes sense to >> conflate the use of the web storage API with a cache pattern. It seems to >> me that the best way to do this would be to make the low-level API >> available and implement a cache on top of that. >> >> On Monday, October 31, 2016 at 2:55:42 AM UTC-4, Peter Damoc wrote: >>> >>> On Mon, Oct 31, 2016 at 8:38 AM, David Andrews <[email protected]> >>> wrote: >>> >>>> I would really like to be able to use local storage in elm. There have >>>> been several libraries that implement this, but none of them have been >>>> updated to elm 0.17. So far the advice I've seen is just to wait, but I'm >>>> tired of waiting. >>>> >>> >>> It's not really storage when you have a hard limit of 5MB of data. >>> persistent-cache <https://github.com/elm-lang/persistent-cache> will >>> probably end up covering the uses for that kind of functionality. >>> >>> You should be using ports but if you really really want to use the >>> unreleased library, fork it, tag it with 1.0.0 and install it with >>> elm-github-install. >>> >>> >>> -- >>> There is NO FATE, we are the creators. >>> blog: http://damoc.ro/ >>> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "Elm Discuss" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/elm-discuss/idgmRP24Aj0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
