delorean icon indicating copy to clipboard operation
delorean copied to clipboard

Bug when using with require.js

Open goette opened this issue 11 years ago • 3 comments

When using delorean with require.js - the preferred way of using flight.js - via

var Flux = require('delorean').Flux

I get Uncaught TypeError: undefined is not a function in delorean.js:105.

Thanks for help and thanks for the great job!

goette avatar Sep 02 '14 16:09 goette

Hello,

If you are using require.js, then you should use AMD way:

require('delorean.js', function (DeLorean) {
  var Flux = DeLorean.Flux;
  // ...
});

f avatar Sep 02 '14 16:09 f

Hey thanks for your quick reply!

As I understand it both methods are equal, hence I get the same error when I use the AMD way as well..

Thanks!

goette avatar Sep 02 '14 18:09 goette

I'm going to test it and fix! :)

f avatar Sep 02 '14 21:09 f