Added sendNetworkRequest to detect appropriate strategy and use it
This commit is contained in:
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 };
|
||||
Reference in New Issue
Block a user