timdown / rangy

A cross-browser JavaScript range and selection library.
MIT License
2.23k stars 367 forks source link

RequireJS support for modules requires some time to pass #452

Open becdetat opened 5 years ago

becdetat commented 5 years ago

It doesn't seem like modules can be used immediately, unless I'm holding something wrong. If I wait a few ms then the module helper methods get added to the rangy object, which is a problem if I want to use the method immediately.

const rangy = require('rangy')
require('rangy/lib/rangy-classapplier')

console.log('immediate', rangy.createClassApplier) // undefined
setTimeout(() => console.log('10ms later', rangy.createClassApplier), 10) // function