[mochikit] Re: .Cookie or .Storage?

2006-08-29 Thread Beau Hartshorne

On 28-Aug-06, at 11:49 AM, Bob Ippolito wrote:

 Sounds like a good idea. Generalized storage would be fine by me, but
 only if the representation is JSON. It would be nice if the cookie
 storage could tell you (by exception or true/false return value) if
 said data didn't fit in a cookie for whatever reason.

How does this API look:

MochiKit.Storage.retrieve(key)

MochiKit.Storage.store(
   key, value
   or {key: value, key1: value1, ...}
   or [[key, value], [key1, value1]]
) - throws when full or unavailable

MochiKit.Storage.destroy(key) - delete()s the key.

MochiKit.Storage.expires(date) - defaults to discard when browser  
session is over. Makes sense for Cookies, but what about FormStorage  
or some other technique?

MochiKit.Storage.setProvider(string) - defaults to Cookie.

MochiKit.Storage.storageUsed()

MochiKit.Storage.storageFree()

Beau

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~--~~~~--~~--~--~---



[mochikit] Re: .Cookie or .Storage?

2006-08-28 Thread Jason Bunting


 -Original Message-
 From: Beau Hartshorne
 Sent: Monday, August 28, 2006 10:58 AM
 To: MochiKit
 Subject: [mochikit] .Cookie or .Storage?
 
 I'd like to add a nice Cookie interface to MochiKit. Working with
 them manually sucks, but they're important for Ajax applications.
 Should we make it a submodule of some kind of Storage component that
 may or may not grow other persistence options?

For what it is worth, I like the idea of abstracting storage and making it a
submodule...

Jason



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.6/428 - Release Date: 8/25/2006
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~--~~~~--~~--~--~---



[mochikit] Re: .Cookie or .Storage?

2006-08-28 Thread Bob Ippolito

On 8/28/06, Jason Bunting [EMAIL PROTECTED] wrote:


  -Original Message-
  From: Beau Hartshorne
  Sent: Monday, August 28, 2006 10:58 AM
  To: MochiKit
  Subject: [mochikit] .Cookie or .Storage?
 
  I'd like to add a nice Cookie interface to MochiKit. Working with
  them manually sucks, but they're important for Ajax applications.
  Should we make it a submodule of some kind of Storage component that
  may or may not grow other persistence options?

 For what it is worth, I like the idea of abstracting storage and making it a
 submodule...

Sounds like a good idea. Generalized storage would be fine by me, but
only if the representation is JSON. It would be nice if the cookie
storage could tell you (by exception or true/false return value) if
said data didn't fit in a cookie for whatever reason.

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~--~~~~--~~--~--~---