I'm trying to write an application using purescript-pux
and CodeMirror, a static code editor.
CodeMirror makes an editor from a text-area
, but the events are handled differently, therefore I cannot use the onChange
function from Pux.Html.Events
.
To handle input changes in a CodeMirror editor, one should do it this way:
CodemirrorInstance.on('change',function(cMirror){
// get value right from instance
var newValue = cMirror.getValue();
});
I'm able to make a Codemirror instance which is some trivial work. The problem I'm having is about how do I make pux
aware of the events.
I have a Channel
which I have subscribed to and I use for handling websocket messages, but I don't really know how could I send something over there from the foreign JavaScript file.