Re: [elm-discuss] 0.17-compatible web storage

2016-10-31 Thread Frederick Yankowski
https://github.com/fredcy/localstorage runs in Elm 0.17 and has storage 
events. The provided examples show it handling some events.

That repo will never be published as an Elm package though.

I originally named it "Storage", thinking to do session storage next. But 
it's a dead end and I gave up that plan.

On Monday, October 31, 2016 at 10:15:06 AM UTC-5, David Andrews wrote:
>
> 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.
>
>>
>>

-- 
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, visit https://groups.google.com/d/optout.


Re: [elm-discuss] 0.17-compatible web storage

2016-10-31 Thread David Andrews
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" <27cupsofcof...@gmail.com> 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 
>>> 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  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
> elm-discuss+unsubscr...@googlegroups.com.
> 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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] 0.17-compatible web storage

2016-10-31 Thread Joe Clay
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  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  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 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, visit https://groups.google.com/d/optout.


Re: [elm-discuss] 0.17-compatible web storage

2016-10-31 Thread Peter Damoc
On Mon, Oct 31, 2016 at 8:38 AM, David Andrews  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  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 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, visit https://groups.google.com/d/optout.