Fork me on GitHub
#re-frame
<
2015-07-10
>
estsauver06:07:05

Probably @surreal.analysis , I’ll put in a patch.

Petrus Theron08:07:50

A common pattern that I am seeing is having two handlers: :some-feature/make-request! with a go-routine that triggers a web request, a handler like :some-feature/response to swap out the response and a subscription or two to provide the loading toggle and response, e.g. :some-feature/loading? and :some-feature/response. Feels like the job for a macro, but it's tricky to choose a good convention and I don't want to clobber other handler keywords. Has anyone investigated this?

estsauver11:07:55

@petrus: the nice thing about sente is that it also works on events

estsauver11:07:07

So, you can have something like a handler for [:data :sente-event-key rest]

estsauver11:07:24

where a :data handler forwards to the sente router

Petrus Theron11:07:59

@estsauver not using sente yet.

estsauver12:07:51

So, if I’m trying to test a reagent component

estsauver12:07:13

to see if say the value “Log in” is somewhere in the generated hiccup, is there a nice way of doing that?

estsauver12:07:23

I’ve been trying to think of how to structure the match or walk call

estsauver12:07:46

I’m thinking about using https://github.com/davidsantiago/hickory to query the result

estsauver12:07:00

but thought I would ask if any of you all have experience with testing reagent thigns?

mikethompson13:07:18

I haven't used it, but perhaps https://github.com/nathanmarz/specter might be what you're after?