[*] 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:
Juan Tejada 2017-02-17 12:30:37 -08:00
parent a95ca8b07a
commit 4d5e69da7d

View file

@ -0,0 +1,8 @@
export function isClientEnv() {
return typeof window !== 'undefined' && typeof window.NylasEnv !== 'undefined'
}
export function isCloudEnv() {
return !isClientEnv()
}