8000 Replace `StateCommand` with `Command` · Positive-Conative/pyscript@2dfc2d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2dfc2d3

Browse files
committed
Replace StateCommand with Command
1 parent 2f91eb6 commit 2dfc2d3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pyscriptjs/src/components/pyrepl.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { basicSetup, EditorState, EditorView } from '@codemirror/basic-setup';
22
import { python } from '@codemirror/lang-python';
3-
import { Compartment, StateCommand } from '@codemirror/state';
4-
import { keymap } from '@codemirror/view';
3+
import { Compartment } from '@codemirror/state';
4+
import { keymap, type Command } from '@codemirror/view';
55
import { defaultKeymap } from '@codemirror/commands';
66
import { oneDarkTheme } from '@codemirror/theme-one-dark';
77

@@ -32,13 +32,13 @@ mode.subscribe(value => {
3232
currentMode = value;
3333
});
3434

35-
function createCmdHandler(el: PyRepl): StateCommand {
35+
function createCmdHandler(el: PyRepl): Command {
3636
// Creates a codemirror cmd handler that calls the el.evaluate when an event
3737
// triggers that specific cmd
38-
const toggleCheckbox: StateCommand = ({ state, dispatch }) => {
39-
return el.evaluate(state);
38+
return () => {
39+
void el.evaluate();
40+
return true;
4041
};
41-
return toggleCheckbox;
4242
}
4343

4444
let initialTheme: string;

0 commit comments

Comments
 (0)
0