How to use the @jupyterlab/application.ModuleLoader function in @jupyterlab/application

To help you get started, we’ve selected a few @jupyterlab/application examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / jupyterlab / src / loader.ts View on Github external
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
  ModuleLoader
} from '@jupyterlab/application';


/**
 * A module loader instance.
 */
const _loader = new ModuleLoader();


/**
 * Define a module that can be synchronously required.
 *
 * @param path - The version-mangled fully qualified path of the module.
 *   For example, "foo@1.0.1/lib/bar/baz.js".
 *
 * @param callback - The callback function for invoking the module.
 */
export
function define(path: string, callback: ModuleLoader.DefineCallback): void {
  _loader.define.call(_loader, path, callback);
}
github jupyterlab / jupyterlab / test / src / application / index.spec.ts View on Github external
describe('JupyterLab', () => {

  let lab: JupyterLab;
  let loader = new ModuleLoader();

  beforeEach(() => {
    lab = new JupyterLab();
  });

  describe('#constructor()', () => {

    it('should create a JupyterLab object', () => {
      expect(lab).to.be.a(JupyterLab);
    });

    it('should accept options', () => {
      lab = new JupyterLab({
        version: 'foo',
        gitDescription: 'foo',
        loader