These are chat archives for rosshinkley/nightmare

12th
Jul 2016
Mingsterism
@mingsterism
Jul 12 2016 15:25
@rosshinkley hey ross. good to hear from you. :)
just want to ask, i'm having this problem below.
RootNightmareInstance.prototype.run = function() {
    const self = this;
    const settings = {
        selector1: Array.from(document.getElementsByClassName('.somethingSelector'))   // <<<<<< Referring to this. 
    }
    function getSelectors() {
        const selector1 = settings.selector1 // <<<< "ReferenceError: document is not defined"
        const selector2 = Array.from(document.getElementsByTagName('.something'))
        return selector2.map((x) => {
            return  // something 
        })
    }
}
i just want to make my code more modular/organized. but i dont know why getting that error above.
Appreciate the help :)
but if i replace settings.selector1 with the actual Array.from ... , then the code works fine.
Mingsterism
@mingsterism
Jul 12 2016 15:33
also, any thoughts on how to separate out the db from the root Class object. Right now, mongoose and nightmare instance all grouped up like below.