This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new RSVP.promise(function(resolve, reject) { | |
| var promise = new RSVP.promise(function(resovle, reject) { | |
| request({ | |
| dataType: 'json', | |
| url: window.ENV.prependHost + "/sa/api/v2/auth" | |
| }) | |
| .then(resolve) // if the first is a success, just resolve! | |
| .catch(function() { // not a success, trying again | |
| request({ | |
| dataType: 'json', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define([], function() { | |
| /* | |
| Public: Returns the query string decoded as an Object | |
| queryArg - a String that is a query string. eg: "one=1&two=2&three" | |
| Returns an Object | |
| */ | |
| return function(queryArg) { | |
| var query = queryArg || window.location.search.substring(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Public: Abstracts pagination into an Enumerator so all of the objects for | |
| # a given response can be retreived without having to know that they were | |
| # split into pages from the server | |
| # | |
| # Examples | |
| # | |
| # orders = client.get("orders", limit: 10) | |
| # | |
| # paged = PagedEnumerator.new(orders) do |response, yielder| | |
| # response.body["orders"].each do |obj| |
NewerOlder