1
1
import { assert } from '@ember/debug' ;
2
2
3
- import { modifier } from 'ember-could-get-used-to-this' ;
4
-
5
3
import type { NamedArgs , PositionalArgs } from './-types' ;
6
4
/**
7
5
* I wish there was a way to specify types-only packages
@@ -13,23 +11,25 @@ import type { NamedArgs, PositionalArgs } from './-types';
13
11
*/
14
12
import type * as monaco from 'monaco-editor' ;
15
13
16
- export default modifier (
17
- ( element : HTMLElement , [ value , updateText ] : PositionalArgs , named : NamedArgs ) => {
18
- assert ( `Expected MONACO to exist` , MONACO ) ;
14
+ export default function installMonaco (
15
+ element : HTMLElement ,
16
+ [ value , updateText ] : PositionalArgs ,
17
+ named : NamedArgs
18
+ ) {
19
+ assert ( `Expected MONACO to exist` , MONACO ) ;
19
20
20
- element . innerHTML = '' ;
21
+ element . innerHTML = '' ;
21
22
22
- let { editor, setText } = MONACO ( element , value , updateText ) ;
23
+ let { editor, setText } = MONACO ( element , value , updateText ) ;
23
24
24
- named . setValue ( ( text ) => {
25
- // changing the text this ways calls updateText for us
26
- // updateText(text); // update the service / URL
27
- setText ( text ) ; // update the editor
28
- } ) ;
25
+ named . setValue ( ( text ) => {
26
+ // changing the text this ways calls updateText for us
27
+ // updateText(text); // update the service / URL
28
+ setText ( text ) ; // update the editor
29
+ } ) ;
29
30
30
- return ( ) => editor ?. dispose ( ) ;
31
- }
32
- ) ;
31
+ return ( ) => editor ?. dispose ( ) ;
32
+ }
33
33
34
34
let MONACO :
35
35
| undefined
0 commit comments