3
我正在嘗試使用purescript-pux
和CodeMirror這個靜態代碼編輯器編寫應用程序。如何從外部模塊生成Pux操作?
CodeMirror從text-area
生成編輯器,但事件處理方式不同,因此我無法使用Pux.Html.Events
中的onChange
函數。
要處理的CodeMirror編輯器輸入的變化,應該做這種方式:
CodemirrorInstance.on('change',function(cMirror){
// get value right from instance
var newValue = cMirror.getValue();
});
我能夠做出Codemirror實例,它是一些瑣碎的工作。我遇到的問題是如何讓pux
意識到事件。
我有我訂閱了Channel
我用處理WebSocket的消息,但我真的不知道我怎麼能送的東西在那邊國外JavaScript文件。