const styles = require('./styles')
const promise = styles.onLoad('foo.css', 'bar.css')
promise.then(() => {
console.log('Stylesheets loaded!')
// Now, measurements can be done safely!
})
Note that the strings passed to onLoad
can be fragments of the stylesheet's full URL. This means foo.css
will match any stylesheet whose href
contains foo.css
.