Skip to content
This repository has been archived by the owner on Sep 29, 2018. It is now read-only.

Commit

Permalink
Merge pull request #31 from atom/wl-defer-require
Browse files Browse the repository at this point in the history
Defer UIWatcher require until needed
  • Loading branch information
50Wliu committed Nov 14, 2017
2 parents debd68b + b9b72dd commit c7b322c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const UIWatcher = require('./ui-watcher')

module.exports = {
activate (state) {
if (!atom.inDevMode() || atom.inSpecMode()) return
Expand All @@ -18,6 +16,7 @@ module.exports = {
},

startWatching () {
const UIWatcher = require('./ui-watcher')
this.uiWatcher = new UIWatcher({themeManager: atom.themes})
this.commandDisposable = atom.commands.add('atom-workspace', 'dev-live-reload:reload-all', () => this.uiWatcher.reloadAll())
if (this.activatedDisposable) this.activatedDisposable.dispose()
Expand Down

0 comments on commit c7b322c

Please sign in to comment.