static getStatsSync()

in src/api/statsApi.js [10:22]


    static getStatsSync() {
        /**
         * Here we want to simulate the bad practice of
         * making synchronous XHRs.
         */
        const req = new window.XMLHttpRequest()
        req.open('GET', '/api/stats', false)
        req.send()

        if (req.status === 200) {
            return JSON.parse(req.responseText)
        }
    }