setEnv
setEnv(
value):void
Defined in: env/index.ts:21
Sets the environment variables used by fabric.
This is exposed for special cases, such as configuring a test environment, and should be used with care.
CAUTION: Must be called before using the package.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Example
Section titled “Example”Passing `window` and `document` objects to fabric (in case they are mocked or something)
import { getEnv, setEnv } from 'fabric';// we want fabric to use the `window` and `document` objects exposed by the environment we are running in.setEnv({ ...getEnv(), window, document });// done with setup, using fabric is now safe