Yahoo! UI Library

gallery-storage-lite  1.0.0

Yahoo! UI Library > gallery-storage-lite > StorageLite
Search:
 
Filters

static Class StorageLite

Provides a persistent local key/value data store similar to HTML5's localStorage.

Methods

clear

void clear ( )
Removes all items from the data store.
Returns: void

getItem

Object|null getItem ( key , json )
Returns the item with the specified key, or null if the item was not found.
Parameters:
key <String>
json <bool> (optional) true if the item is a JSON string and should be parsed before being returned
Returns: Object|null
item or null if not found

length

Number length ( )
Returns the number of items in the data store.
Returns: Number
number of items in the data store

removeItem

void removeItem ( key )
Removes the item with the specified key.
Parameters:
key <String>
Returns: void

setItem

void setItem ( key , value , json )
Stores an item under the specified key. If the key already exists in the data store, it will be replaced.
Parameters:
key <String>
value <Object>
json <bool> (optional) true if the item should be serialized to a JSON string before being stored
Returns: void

Events

storage-lite:ready

storage-lite:ready ( )
Fired when the storage interface is loaded and ready for use.


Copyright © 2010 Yahoo! Inc. All rights reserved.