Added sendNetworkRequest to detect appropriate strategy and use it
This commit is contained in:
parent
61d7dcf61b
commit
3726f0a376
1 changed files with 13 additions and 0 deletions
13
functions/network.js
Normal file
13
functions/network.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import AxiosStrategy from "./strategies/AxiosStrategy";
|
||||
import ProxyStrategy from "./strategies/ProxyStrategy";
|
||||
|
||||
|
||||
const sendNetworkRequest = (req, store) => {
|
||||
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
||||
return ProxyStrategy(req, store);
|
||||
} else {
|
||||
return AxiosStrategy(req, store);
|
||||
}
|
||||
}
|
||||
|
||||
export { sendNetworkRequest };
|
||||
Loading…
Reference in a new issue