Fork me on GitHub
#re-frame
<
2015-11-29
>
jmmk21:11:28

does anyone have a favored library to use in vanilla JS when you can't reach for cljs/re-frame? I've been looking into redux but the async workflow seems much poorer than re-frame (in re-frame you just dispatch another event to add to the queue, but in redux it's an unsolved problem with about 15 third-party solutions and just as many discussions in the Github issues)

roberto21:11:43

have you looked into cycle.js?

jmmk21:11:40

I'll check it out

jmmk21:11:37

I'm prototyping a small app to try and convince coworkers to move away from jquery spaghetti to some JS framework, so I'm trying to limit the number of new concepts I introduce. RX and alternative DOM libraries may be a bit of a reach, though I see it can be used with react and JSX which is nice

roberto21:11:47

there is vue.js as well

mikethompson21:11:27

There's been various attempts to port the Elm Architecture into js land. Cycle.js is one of them (but you'll be using virtual-dom, not React). I also like this snabbdom-based approach: https://medium.com/@yelouafi/react-less-virtual-dom-with-snabbdom-functions-everywhere-53b672cb2fe3#.mh5vs534d. If you want to be strictly React there's .... hmmm let me find it .... starts with 'y' ...

roberto21:11:18

anyone tried using goog.async.Debouncer ?

jmmk21:11:19

@mikethompson: not necessarily strictly react, but I like the idea of keeping a semi-standard templating language that users of Handlebars et al. will be familiar with (looks and feels like HTML)

roberto21:11:32

somehow importing goog.async.Debouncer is failing

jmmk21:11:01

@mikethompson: Would it be hard to do a straight-up port of re-frame in JS?

jmmk21:11:06

I guess the reagent atom is big for subscriptions

jmmk21:11:10

and reaction

jmmk21:11:31

but maybe redux with the re-frame router

mikethompson21:11:19

redux always seemed pretty close to re-frame ... right down to middleware (but without the slightest credit :-() ,,, but again with a bias towards the more pure Elm way of doing things

mikethompson21:11:10

@jmmk: this might provide a good source of comparison - https://github.com/staltz/flux-challenge

mikethompson21:11:14

Yolk! That's the library I was looking for above ... the one that is like Cycle.js but uses React: https://github.com/garbles/yolk