diff --git a/functions/network.js b/functions/network.js new file mode 100644 index 000000000..f2089363e --- /dev/null +++ b/functions/network.js @@ -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 };