ForestAdmin/toolbelt

View on GitHub
src/context/static.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
const path = require('path');

const Context = require('@forestadmin/context');

const staticPlan = plan => plan.addModule('path', path);

let staticContext;

const init = () => {
  if (!staticContext) {
    staticContext = Context.execute(staticPlan);
  }
  return staticContext;
};

module.exports = {
  init,
};