Skip to content

Commit

Permalink
feat(contentful): Introduce createClientWithCustomHttpVendor
Browse files Browse the repository at this point in the history
Introduc a way of creating a client with custom http vendor instance
  • Loading branch information
Khaledgarbaya committed Jul 7, 2016
1 parent d677e01 commit f9b29d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ var contentful = require('./dist/contentful').default
module.exports = {
createClient: function (params) {
return contentful(axios, params)
},
// This is intended to be used only for debug reasons
// e.g: if you want to add interceptor to axios or if you want to use a different vendor
// if you want to use a different vendor than axios make sure it is using promises
createClientWithCustomHttpVendor: function (httpVendor, params) {
return contentful(httpVendor, params)
}
}
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ try {
module.exports = {
createClient: function (params) {
return contentful(axios, params)
},
// This is intended to be used only for debug reasons
// e.g: if you want to add interceptor to axios or if you want to use a different vendor
// if you want to use a different vendor than axios make sure it is using promises
createClientWithCustomHttpVendor: function (httpVendor, params) {
return contentful(httpVendor, params)
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "contentful",
"version": "1.0.0-determined-by-semantic-release",
"description": "Client for Contentful's Content Delivery API",
"homepage": "https://www.contentful.com/developers/documentation/content-delivery-api/",
"main": "index.js",
Expand Down

0 comments on commit f9b29d3

Please sign in to comment.