Fixed typo

This commit is contained in:
inaseem 2021-11-02 17:53:01 +05:30
parent f3172ca397
commit 5aab10c613
3 changed files with 17 additions and 16 deletions

View File

@ -1,4 +1,5 @@
import MonacoEditor from "@monaco-editor/react";
import {
createConnection,
MonacoLanguageClient,
@ -36,7 +37,7 @@ const RijuEditor = (props) => {
}
});
() => {
EventEmitter.unsubcribe(token1, token2);
EventEmitter.unsubscribe(token1, token2);
if (clientDisposable) {
clientDisposable.dispose();
clientDisposable = null;
@ -58,16 +59,16 @@ const RijuEditor = (props) => {
// const newURI = `file://${message.root}/${config.main}`;
// const oldModel = editor.getModel();
// if (oldModel.uri.toString() !== newURI) {
// This code is likely to be buggy as it will probably
// never run and has thus never been tested.
// editor.setModel(
// monaco.editor.createModel(
// oldModel?.getValue(),
// undefined,
// monaco.Uri.parse(newURI)
// )
// );
// oldModel.dispose();
// // This code is likely to be buggy as it will probably
// // never run and has thus never been tested.
// editor.setModel(
// monaco.editor.createModel(
// oldModel?.getValue(),
// undefined,
// monaco.Uri.parse(newURI)
// )
// );
// oldModel.dispose();
// }
const connection = createMessageConnection(

View File

@ -42,7 +42,7 @@ function RijuTerminal() {
EventEmitter.dispatch("send", { event: "terminalInput", input: data });
});
() => EventEmitter.unsubcribe(token1, token2);
() => EventEmitter.unsubscribe(token1, token2);
}, []);
return (

View File

@ -15,11 +15,11 @@ export const EventEmitter = {
this.events[event][token] = callback;
return token;
},
unsubcribe: function (...tokens) {
for (let k of Object.keys(events)) {
let toks = Object.keys(events[k]);
unsubscribe: function (...tokens) {
for (let k of Object.keys(this.events)) {
let toks = Object.keys(this.events[k]);
for (let tok of toks) {
if (tokens.includes(tok)) delete events[k][tok];
if (tokens.includes(tok)) delete this.events[k][tok];
}
}
},