How to use the amdefine.js function in amdefine

To help you get started, we’ve selected a few amdefine 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 remotestorage / remotestorage.js / test / unit / remotestorage-suite.js View on Github external
if (typeof(define) !== 'function') {
  var define = require('amdefine.js');
}
define(['require', 'tv4', './src/eventhandling'], function (require, tv4, eventHandling) {
  var suites = [];

  var consoleLog, fakeLogs;
  global.XMLHttpRequest = require('xhr2').XMLHttpRequest;

  function FakeRemote(connected) {
    this.fakeRemote = true;
    this.connected = (typeof connected === 'boolean') ? connected : true;
    this.configure = function() {};
    this.stopWaitingForToken = function() {
      if (!this.connected) {
        this._emit('not-connected');
      }
    };
    eventHandling(this, 'connected', 'disconnected', 'not-connected');
  }

amdefine

Provide AMD's define() API for declaring modules in the AMD format

BSD-3-Clause OR MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis

Popular amdefine functions