Fork me on GitHub
#hoplon
<
2016-07-15
>
martinklepsch09:07:03

A question: in the timer example on http://hoplon.io, how is the timer disposed once it's no longer needed?

alandipert10:07:20

It's never not needed? The way to control it would be to pass a cell argument to the defelem that once false, cancelled timer

alandipert10:07:01

Like an optional attr

tbrooke11:07:13

@flyboarder: You mentioned Firebase previously. Why don’t you add Firebase example to Brew?

flyboarder14:07:14

@tbrooke: that's a good idea, I'll whip something together today

shaun-mahood14:07:34

I've been looking into Hoplon after the awesome interview on https://defn.audio/ and I am pretty interested. I was looking at Castra and wondering if I could bring it in to some of my existing applications, as the RPC style seems to be a much better fit than what I have in there right now. Is it possible to use Castra with a react based front end (reagent, rum, om) and are there any examples?

alandipert15:07:45

@shaun-mahood: totally possible, i'm not aware of any examples

shaun-mahood15:07:19

@alandipert: I assume I would have to pull in Hoplon and integrate cells in some fashion? Then just use the react based library in place of Javelin?

alandipert15:07:27

you would pull castra into your server and client. on the server for the ring middleware defrpc macro, and on the client for the mkremote macro

alandipert15:07:36

javelin would come transitively

alandipert15:07:52

mkremote creates a javelin cell, which behaves like a clojure atom

alandipert15:07:10

so you could attach your rendering lib to the mkremote javelin cell the same as you'd attach renderign stuff to a clojure atom

alandipert15:07:25

does that make sense?

shaun-mahood15:07:52

Totally makes sense, doesn't even sound like it would be hard 🙂 Thanks!

alandipert15:07:21

err, mkremote doesn't even create a javelin cell, it takes the cell to put results/errors into as an argument

alandipert15:07:29

i believe you can pass it atoms and it will work

alandipert15:07:12

cool, yeah, looking at mkremote - https://github.com/hoplon/castra/blob/master/src/castra/core.cljs#L113-L131 - it only does reset! and swap! on the state/error/loading arguments. so you could pass it anything that implements the IReset/ISwap protocols including native atoms

shaun-mahood15:07:55

Oh that's really cool! My current apps are built with re-frame and the RPC nature of Castra looks like it should fit really nicely with re-frames concept of subscriptions and events. Now I'm curious if javelin cells might make for a more interesting atom to store the data though too.

shaun-mahood15:07:54

I'm really enjoying the concepts and thought put into Hoplon so far, seems like a really solid project and a really interesting take on thngs.

flyboarder16:07:47

@tbrooke: https://github.com/hoplon/brew/pull/2 has everything I think you’ll need for the actual hoplon/javelin integration this version was recreated from production code and needs to be tested ie. with-auth! may not work

flyboarder18:07:56

^ added a wiki page for brew

alandipert19:07:06

@shaun-mahood: oh i should also mention, http://adzerk.com/blog/2015/06/splint-functional-first-aid-jquery/ shows a peculiar way of using javelin outside of hoplon that might be helpful in understanding

alandipert19:07:30

mostly it shows how to work with values instead of channels/events

shaun-mahood19:07:22

@alandipert: Oh that looks useful, thanks. I have a couple of legacy jQuery applications I support right now too, so I may end up using it for that too 🙂

martinklepsch21:07:09

> It's never not needed? In the example yes but generally there might be parts of your application that need a thing and then these parts are removed from the page, thus the thing is no longer needed. I was wondering how hoplon deals with the, I'm afraid to use the word, lifecycle of components

alandipert21:07:41

Yeah, one would need to develop ones own lifecycle convention

alandipert21:07:30

Of the conventions, dynamic binding seems the most common

alandipert21:07:08

As far as I've seen and used anyway