Skip to content

Commit

Permalink
update README with new get method API
Browse files Browse the repository at this point in the history
  • Loading branch information
clalimarmo committed Dec 12, 2014
1 parent f8225b2 commit 486b56a
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ bucket.

cloudStore.put(objectName, jsonDocument);

cloudStore.get(objectName, function(retrievedDocument) {
//do something with retrieved json document
cloudStore.get(objectName, {
success: function(retrievedDocument) {
//do something with retrieved json document
},
error: function(jqXHR, status, errorThrown) {
//do something about error
}
});

## Notes
Expand All @@ -36,11 +41,15 @@ The module is provided as an AMD module, with simplified CommonJS wrapping.
It's compatible with RequireJS, I haven't tried it in other contexts.

So that there isn't a package dependency on jquery, we pass it into the
initialization function. We only use the `ajax` method of jquery, so if
you don't already use jquery, and don't want to introduce it to your project
you can provide your own http adapter, as long as the `ajax` method matches
initialization function. We only use the `ajax` method of jquery, so if you
don't already use jquery, and don't want to introduce it to your project you
can provide your own http adapter, as long as the `ajax` method matches
jquery's signature and behavior. (This also simplifies testing).

Also note: while we assume that `http.ajax` will match the jquery method's
signature, the success and error callbacks can be passed whatever you want, as
long as your callbacks agree with your implementation of the ajax method.

## Development

To run the tests:
Expand Down

0 comments on commit 486b56a

Please sign in to comment.