UNPKG

@lonelyplanet/dotcom-core

Version:

This package is meant to house some of our more common UI and shared libs across dotcom applications.

28 lines (23 loc) 875 B
import { Container } from "inversify"; import Renderer from "../classes/renderer"; import { hydrate } from "react-dom"; import { renderToString } from "react-dom/server"; import Core from "../classes/core"; import registry from "../classes/registry"; import { ICore, IRenderer, IRequire, IRenderOptions, IAuthOptionsDefaults, } from "../interfaces"; import TYPES from "../types"; import { authDefaults } from "../constants"; const container = new Container(); container.bind<IAuthOptionsDefaults>(TYPES.IAuthConfigDefaults).toConstantValue(authDefaults); container.bind<ICore>(TYPES.ICore).to(Core); container.bind<IRequire>(TYPES.IRequire).toFunction(registry); container.bind<IRenderer>(TYPES.IRenderer).to(Renderer); container.bind(TYPES.render).toFunction(hydrate); container.bind(TYPES.renderToString).toFunction(renderToString); export default container;