feat(v2): add ExecutionEnvironment API (#2296)

* feat(v2): add ExecutionEnvironment API

* remove redundant code
This commit is contained in:
Yangshun Tay 2020-02-19 09:22:14 +08:00 committed by GitHub
parent e6562859fd
commit d974aa9c2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 77 additions and 21 deletions

View file

@ -5,8 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
export default (function() {
if (typeof window === 'undefined') {
if (!ExecutionEnvironment.canUseDOM) {
return null;
}