Comparing version 2.0.1 to 2.0.2
@@ -15,7 +15,5 @@ import _regeneratorRuntime from 'babel-runtime/regenerator'; | ||
import dedupe from 'promise-dedupe'; | ||
import timeout from '@trungdq88/promise-timeout'; | ||
export var configs = { | ||
REDUCER_NAMESPACE: '@@dequest', | ||
DEFAULT_TIMEOUT: 10000 // 10 secs | ||
REDUCER_NAMESPACE: '@@dequest' | ||
}; | ||
@@ -220,5 +218,3 @@ | ||
return transform(dedupe(action.requestId, timeout(resolveRequest(api, action), configs.DEFAULT_TIMEOUT, { | ||
errorMessage: 'Connection timeout' | ||
}))).then(function (r) { | ||
return transform(dedupe(action.requestId, resolveRequest(api, action))).then(function (r) { | ||
return store.dispatch({ | ||
@@ -225,0 +221,0 @@ type: '@@DEQUEST/RECEIVE', |
@@ -175,3 +175,3 @@ import _regeneratorRuntime from 'babel-runtime/regenerator'; | ||
store.dispatch(makeRequest('test', get(fakeRequest, fakeParams))); | ||
expect(mockGet).toHaveBeenCalledWith(fakeRequest, fakeParams); | ||
expect(mockGet.mock.calls[0][0].request.args).toEqual([fakeRequest, fakeParams]); | ||
}); | ||
@@ -188,3 +188,3 @@ }); | ||
store = createStoreWithMockApi({ | ||
get: function get(time) { | ||
get: function get(action) { | ||
return new Promise(function (resolve) { | ||
@@ -196,5 +196,6 @@ return setTimeout(function () { | ||
ok: true, | ||
jsonBody: { data: time } | ||
jsonBody: { data: action.request.args[0] } | ||
})); | ||
}, time); | ||
}, action.request.args[0] // time, | ||
); | ||
}); | ||
@@ -201,0 +202,0 @@ } |
{ | ||
"name": "dequest", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "author": "Trung Dinh Quang <trungdq88@gmail.com>", |
import { createSelector } from 'reselect'; | ||
import dedupe from 'promise-dedupe'; | ||
import timeout from '@trungdq88/promise-timeout'; | ||
export const configs = { | ||
REDUCER_NAMESPACE: '@@dequest', | ||
DEFAULT_TIMEOUT: 10000, // 10 secs | ||
}; | ||
@@ -136,10 +134,3 @@ | ||
return transform( | ||
dedupe( | ||
action.requestId, | ||
timeout(resolveRequest(api, action), configs.DEFAULT_TIMEOUT, { | ||
errorMessage: 'Connection timeout', | ||
}), | ||
), | ||
) | ||
return transform(dedupe(action.requestId, resolveRequest(api, action))) | ||
.then(r => | ||
@@ -146,0 +137,0 @@ store.dispatch({ |
@@ -135,3 +135,6 @@ import dequest, { | ||
store.dispatch(makeRequest('test', get(fakeRequest, fakeParams))); | ||
expect(mockGet).toHaveBeenCalledWith(fakeRequest, fakeParams); | ||
expect(mockGet.mock.calls[0][0].request.args).toEqual([ | ||
fakeRequest, | ||
fakeParams, | ||
]); | ||
}); | ||
@@ -143,3 +146,3 @@ }); | ||
const store = createStoreWithMockApi({ | ||
get: time => | ||
get: action => | ||
new Promise(resolve => | ||
@@ -153,6 +156,6 @@ setTimeout( | ||
ok: true, | ||
jsonBody: { data: time }, | ||
jsonBody: { data: action.request.args[0] }, | ||
}), | ||
), | ||
time, | ||
action.request.args[0], // time, | ||
), | ||
@@ -159,0 +162,0 @@ ), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175494
1042