Exenv
React's ExecutionEnvironment module extracted.
Many modules and components out there in the wild, uses React's private ExecutionEnvironment
lib for feature detection, like:
1
|
|
Which is not a good practice as private libs are prone to modification or deletion, so Jed Watson has created
exenv
for us.
P.S: isInWorker
has been left out as it's very specific to react.
Install it: npm install --save exenv
Sample usage:
1 2 3 |
|
GIF FTW!