bobbicodes / calc

Graphing calculator in Clojure via sci
https://bobbicodes.github.io/calc/
4 stars 0 forks source link

Eliminate run button #1

Open bobbicodes opened 3 years ago

bobbicodes commented 3 years ago

Before I decided to try Nextjournal's clojure-mode I was just using a plain textarea box to evaluate the function with sci, getting a callback from on-change, validating it and updating the graph.

I think I like it that way better, but I can't figure out how to get a new value when the codemirror editor content changes, hence the "run" button.

I think the answer to this problem is to spend some time with the Codemirror 6 docs until I understand it well enough to figure it out, because I don't know of any examples of using for continuous evaluation like Klipse or the like.

bobbicodes commented 3 years ago

One way to avoid doing the above could be to simply set a timer to poll the editor with SetInterval, check if it has changed and do accordingly.