Closed JoviDeCroock closed 5 years ago
Thanks for this one! Happy to merge this but I'll put on hold until I add something to the README.
How do you feel about urql
exposing a conditional exchange function?
[dedupExchange, conditionalExchange(devtoolsExhcange, true), otherExchange]
The problem I see forming is the nested conditions for this. Normally terser and stuff should be able to handle this but yes, not entirely sure if all minifiers can.
I think this is the correct way to tackle https://github.com/FormidableLabs/urql-devtools/issues/48 now that
useDevtoolsContext
is integrated into this library. A user is actively encouraged to do the following:If the consumer of the application doens't want it enabled in production it won't be and the bundle size won't be affected since terser will eliminate the code.