mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 02:30:21 +08:00
[*] metrics(Part 1) Add env-helpers to iso core
Summary: This is a set of functions which will allow isomorphic-core to detect which environment it is running on. This will be useful for moving the metrics reporter to iso-core Test Plan: manual Reviewers: mark, spang Reviewed By: spang Differential Revision: https://phab.nylas.com/D3966
This commit is contained in:
parent
a95ca8b07a
commit
4d5e69da7d
1 changed files with 8 additions and 0 deletions
8
packages/isomorphic-core/src/env-helpers.es6
Normal file
8
packages/isomorphic-core/src/env-helpers.es6
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
export function isClientEnv() {
|
||||
return typeof window !== 'undefined' && typeof window.NylasEnv !== 'undefined'
|
||||
}
|
||||
|
||||
export function isCloudEnv() {
|
||||
return !isClientEnv()
|
||||
}
|
Loading…
Reference in a new issue