Commit 3ef1db2 1 parent 9266747 commit 3ef1db2 Copy full SHA for 3ef1db2
File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
1
import { CompositeDisposable , Emitter , Disposable } from 'atom'
2
2
3
- // https://github.com/ atom/atom -select-list/pull/31
4
- let SelectListView : any
3
+ let SelectListViewImport : ( typeof import ( " atom-select-list" ) ) [ "default" ]
4
+
5
5
type ToggleAction = 'enable' | 'disable'
6
6
7
7
export default class ToggleView {
@@ -40,19 +40,21 @@ export default class ToggleView {
40
40
}
41
41
atom . config . set ( 'linter.disabledProviders' , this . disabledProviders )
42
42
}
43
- show ( ) {
44
- if ( ! SelectListView ) {
45
- SelectListView = require ( 'atom-select-list' )
43
+ async show ( ) {
44
+ if ( SelectListViewImport === undefined ) {
45
+ SelectListViewImport = ( await import ( 'atom-select-list' ) ) . default
46
46
}
47
- const selectListView = new SelectListView ( {
47
+ const selectListView = new SelectListViewImport ( {
48
48
items : this . getItems ( ) ,
49
49
emptyMessage : 'No matches found' ,
50
- elementForItem : ( item : any ) => {
50
+ // @ts -ignore
51
+ elementForItem : ( item : string ) => {
51
52
const li = document . createElement ( 'li' )
52
53
li . textContent = item
53
54
return li
54
55
} ,
55
- didConfirmSelection : ( item : any ) => {
56
+ // @ts -ignore
57
+ didConfirmSelection : ( item : string ) => {
56
58
try {
57
59
this . process ( item )
58
60
this . dispose ( )
You can’t perform that action at this time.
0 commit comments