Skip to content

Commit

Permalink
fix: lazy load MinimapPluginGeneratorElement
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 28, 2020
1 parent dac13bd commit 392f6d9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { Emitter, CompositeDisposable } from 'atom'
import MinimapElement from './minimap-element'
import Minimap from './minimap'
import MinimapPluginGeneratorElement from './minimap-plugin-generator-element'
import config from './config.json'
import { deactivateAllPlugins } from './plugin-management'

Expand Down Expand Up @@ -73,14 +72,14 @@ export function activate () {
'minimap:toggle': () => {
toggle()
},
'minimap:generate-coffee-plugin': () => {
generatePlugin('coffee')
'minimap:generate-coffee-plugin': async () => {
await generatePlugin('coffee')
},
'minimap:generate-javascript-plugin': () => {
generatePlugin('javascript')
'minimap:generate-javascript-plugin': async () => {
await generatePlugin('javascript')
},
'minimap:generate-babel-plugin': () => {
generatePlugin('babel')
'minimap:generate-babel-plugin': async () => {
await generatePlugin('babel')
}
})

Expand Down Expand Up @@ -160,7 +159,8 @@ export function toggle () {
*
* @param {string} template the name of the template to use
*/
export function generatePlugin (template) {
async function generatePlugin (template) {
const { default: MinimapPluginGeneratorElement } = await import('./minimap-plugin-generator-element')
const view = new MinimapPluginGeneratorElement()
view.template = template
view.attach()
Expand Down

0 comments on commit 392f6d9

Please sign in to comment.