www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Resources API Reference Mojo.Depot.get(key, onSuccess, onFailure)

Mojo.Depot.get(key, onSuccess, onFailure)

Function to retrieve an object identified by key from a depot. The default bucket specified by _defaultBucketName is used.

Parameters Type Description
key String Key to identify the object to be retrieved from the depot.
onSuccess Function Function called if the object is successfully retrieved.  Function is passed the retrieved object as its first parameter.  If no object found for specified key, null is passed to function.
onFailure Function Function called if retrieval fails.  Function is passed an error string as its only argument.

Example usage:

db = new Mojo.Depot({name:"feedDB", version:1, estimatedSize:25000, replace: false}, 
     this.dbOpenOK.bind(this), this.dbOpenFail.bind(this)); 
FeedListAssistant.prototype.dbOpenOK = function() { 
    Mojo.Log.info("........","Database opened OK"); 
    db.get("feedList", this.updateList.bind(this), 
      this.useDefaultList.bind(this)); 
}; 
 

0 Comments

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)