perf: ~40ms improvement: Lazy load controllers and page components

This commit is contained in:
Feross Aboukhadijeh
2016-10-01 01:09:51 -07:00
parent 5815d8efe7
commit fcae064dbb
8 changed files with 107 additions and 87 deletions

View File

@@ -112,7 +112,7 @@ function dispatch (...args) {
function hide () {
if (!main.win) return
main.win.send('dispatch', 'backToList')
dispatch('backToList')
main.win.hide()
}

View File

@@ -9,7 +9,6 @@ const webtorrent = module.exports = {
const electron = require('electron')
const config = require('../../config')
const log = require('../log')
function init () {
const win = webtorrent.win = new electron.BrowserWindow({
@@ -52,7 +51,6 @@ function send (...args) {
function toggleDevTools () {
if (!webtorrent.win) return
log('toggleDevTools')
if (webtorrent.win.webContents.isDevToolsOpened()) {
webtorrent.win.webContents.closeDevTools()
webtorrent.win.hide()