Module

isomorphy

import { isomorphy } from '@dr.pogodin/react-utils';

Collection of helpers for dealing with isomorphic aspects of code (mostly environment checks: client- or server-side, development or production, etc.).

Beware: This module relies on Babel and Webpack configurations provided by react-utils library being used by the host code, along with provided methods for server creation and client-side app initialization. It won't work correctly with a different app setup.

View Source src/shared/utils/isomorphy.js, line 1

Members

# static constant IS_CLIENT_SIDE

import { isomorphy } from '@dr.pogodin/react-utils';
const { IS_CLIENT_SIDE } = isomorphy;

true within client-side environment (browser), false at server-side.

View Source src/shared/utils/isomorphy.js, line 26

# static constant IS_SERVER_SIDE

import { isomorphy } from '@dr.pogodin/react-utils';
const { IS_SERVER_SIDE } = isomorphy;

true within the server-side environment (node), false at client-side.

View Source src/shared/utils/isomorphy.js, line 36

Methods

# static buildTimestamp() → {string}

import { isomorphy } from '@dr.pogodin/react-utils';
const { buildTimestamp } = isomorphy;

Returns build timestamp of the front-end JS bundle.

View Source src/shared/utils/isomorphy.js, line 92

ISO date/time string.

string

# static getBuildInfo() → {object}

import { isomorphy } from '@dr.pogodin/react-utils';
const { getBuildInfo } = isomorphy;

Returns build info object.

View Source src/shared/utils/isomorphy.js, line 80

object

# static isDevBuild() → {boolean}

import { isomorphy } from '@dr.pogodin/react-utils';
const { isDevBuild } = isomorphy;

Returns true if development version of the code is running; false otherwise.

View Source src/shared/utils/isomorphy.js, line 55

boolean

# static isProdBuild() → {boolean}

import { isomorphy } from '@dr.pogodin/react-utils';
const { isProdBuild } = isomorphy;

Returns true if production build of the code is running; false otherwise.

View Source src/shared/utils/isomorphy.js, line 68

boolean