Created
August 7, 2018 17:49
-
-
Save afontcu/c7a5fd5859e1e1af29c6909e42815e52 to your computer and use it in GitHub Desktop.
This file contains 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
apiRequest({ // notice the curly braces! we are passing an object now | |
endpoint: 'products', | |
method: 'GET', | |
getParams: { category: 3 }, | |
headers: ["Content-Type: text/plain"], | |
callback: function(response) {}, | |
timeout: 0, | |
authRequest: true | |
}) | |
// somewhere else: | |
function apiRequest({ // notice the curly braces! we are receiving an object now | |
endpoint, | |
method, | |
getParams, | |
headers, | |
callback, | |
timeout, | |
authRequest, | |
}) { | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment