Fork me on GitHub
#hoplon
<
2017-11-01
>
Garrett Hopper15:11:12

Can Javelin do server side rendering? I'm wanting to have some cell= cells to send updated fields back to the server (no matter where they're updated from), though I don't want them running when the app first starts. They should only be run on subsequent updates.

dm315:11:28

I have a fork which runs on JVM/self-host (nodejs)

dm315:11:38

haven’t tried Hoplon though

Garrett Hopper15:11:03

@dm3 Does Javelin not already run on JVM as well? I thought it did, though I wasn't sure how to get that state into the rendered cells.

Garrett Hopper15:11:47

At the moment this seems to work, though I'm not sure if it's really acceptible:

(defmacro change= [form]
  `(let [run# (volatile! false)]
     (j/cell= (if @run#
                ~form
                (vreset! run true)))))

(change= (println "cell changed" cell))

Garrett Hopper15:11:43

Plus it required the client to recalculate the cell.

dm315:11:59

oh, there’s a namespace

dm315:11:08

in the master branch

dm315:11:17

but it was sort of unmaintained and lacked some features

dm315:11:43

sure, your solution will work

Garrett Hopper15:11:02

Does it make sense to use it in this way?

dm315:11:50

why wouldn’t it?

Garrett Hopper15:11:24

I'm not sure. It doesn't feel quite right. I haven't done this spreadsheet type of stuff before. 🤷

dm315:11:23

depends on your application

dm315:11:34

execution model

dm315:11:42

performance requirements

Garrett Hopper15:11:50

Worth a shot I guess. Thanks

kennytilton22:11:06

@ghopper It does not feel right only because you are pushing the envelope having cleverly worked out that formulas can benefit from a bit of state in certain edge cases. I myself happen today to be working on a formula that returns the delta of consecutive values, and have also done formula that do not return a new value until a threshhold delta is reached. Yes, we are stealing RxJS’s lunch.