bbc / slayer

JavaScript time series spike detection for Node.js and the browser; like the Octave findpeaks function.
https://npmjs.org/slayer
Apache License 2.0
79 stars 16 forks source link

Remove calls to `require` in `.use` #6

Closed thom4parisot closed 8 years ago

thom4parisot commented 8 years ago

It is a BC break as a string can be expected and the module gets loaded dynamically.

I'd rather stick to:

const slayer = require('slayer');
const defaultAlgorithm = require('slayer/algorithms/default');

slayer.use(defaultAlgorithm);

And obviously, having it configured by default to avoid the hassle of manually registering it.