UNPKG

kia-ml

Version:

Kia

47 lines (38 loc) 1.27 kB
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } import { Api } from '../services/api'; // let ReactotronDev // if (__DEV__) { // const { Reactotron } = require("../services/reactotron") // ReactotronDev = Reactotron // } /** * The environment is a place where services and shared dependencies between * models live. They are made available to every model via dependency injection. */ export class Environment { constructor() { _defineProperty(this, "api", void 0); _defineProperty(this, "clientUserId", void 0); // create each service // if (__DEV__) { // // dev-only services // this.reactotron = new ReactotronDev() // } this.api = new Api(); } async setup(apiConfig) { // allow each service to setup // if (__DEV__) { // await this.reactotron.setup() // } await this.api.setup(apiConfig); if (apiConfig.clientUserId) this.clientUserId = apiConfig.clientUserId; } /** * Reactotron is only available in dev. */ // reactotron: typeof ReactotronDev /** * Our api. */ } //# sourceMappingURL=environment.js.map