Fork me on GitHub
#hoplon
<
2016-12-19
>
laforge4904:12:57

Hoplon text/let question. Why is fx undefined in this snippit?

laforge4904:12:09

Everything was working find until I added fk and rel. @micha?

adamw09:12:02

Hi folks, what's the recommended way of getting server-driven updates (push notifications, sort of) in a hoplon/castra app? Occasional polling? Or something else?

jumblerg09:12:43

@adamw: polling is the recommended approach.

laforge4910:12:52

I've dropped castra in favor of websockets. See https://github.com/rolonicArk/simpleArk/ but ignore the out of date docs. Or look at https://github.com/tiples/welcome/ which has older code but better docs.Simply stated, I use http-kit and com.taoensso/sente.

laforge4910:12:19

And note that when websoketts are not available, senta falls back on AJAX.

laforge4910:12:16

But working with senta is much easier. 🙂

mynomoto11:12:04

@laforge49 the text macro expects a string afaik. It uses interpolation so you can have arbitrary call inside the string. So you can do (h/text "~(my-function arg1 arg2)") and it will return a text node with the result of calling (my-function arg1 arg2)

mynomoto11:12:39

There is also "~{value}" when you don't want function calls.

mynomoto11:12:20

Also it's reactive, so if arg1 is a cell, it will update when the value in the cell changes.

mynomoto11:12:25

So I would recommend you to extract the let to a function and call it inside h/text the way I showed above.

laforge4914:12:08

Yeah, that's my plan @mynomoto. I was just surprised that I could have 2 bindings in a let but not 3.

flyboarder17:12:54

Also using web sockets for events now

micha18:12:10

you can have as many bindings in a let as you want

jamieorc21:12:08

@alandipert WRT > gonna work with jesse on a 'canonical' full-stack example that shows use of all the stuff we advocate

jamieorc21:12:36

I added a skeleton wiki page to track libs for just such a thing last week: https://github.com/hoplon/hoplon/wiki/Libs-for-Full-Stack-Hoplon-Web-Apps

jamieorc21:12:33

Hoping that some of you all who have built these can fill it in over time for those of us who haven’t. It’d be nice for newbies coming in not to have to search the web for this stuff.