Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add back ability to customise OkHttp client
Prior to 0a71f48, users could customise the OkHttp client used by React Native on Android by calling replaceOkHttpClient in OkHttpClientProvider. This functionality has a variety of legitimate applications from changing connection timeouts or pool size to Stetho integration. The challenge is to add back support for replacing the client without causing a breaking change or undoing the problems @olegbl sought to address in his original commit. Introducing a client factory achives these aims, it adds a new, backwards compatible interface and is called each time a client is requested rather than re-using the same instance (unless you explicitly want this behaviour, in which case you could replicate it using a static class property inside your custom factory).
- Loading branch information