1. Summary
  2. Om Next
    1. Links
    2. Parsing

    Summary

    React and clojurescript fit together very naturally. There are several clojurescript libraries that use react including:

    • Om Next is a framework for building single page apps in react and cljs. It incorporates some really cool ideas from flux and falcor.
    • Reagent is a library for building single page apps in react and cljs. It's easier to understand than om in my opinion.
    • Quiescent is a library for building single page apps in react and cljs. I haven't used this one very much.
    • re-frame is a library that adds to ideas from Reagent. It allows you to build a fully "reactive" single page app. Reagent allows you to build up pieces of UI and reframe helps you combine them all together into an application.
    • devcards is an awesome way to prototype UI's and explore clojurescript and javascript libraries.
    • sablono allows you to use hiccup syntax to build react components. It's meant to be used with other libraries.
    • hoplon is a group of libraries for building SPA using clojurescript and jquery.

    Om Next

    Links

    Parsing

    Use the parser function to associate read and mutate functions.

    The read function should accept 3 params: env, key, and params.

    The env param contains the following keys:

    • :state : this is the application state
    • :parser : the parser function
    • :query : any subquery, like the subquery in a join
    • :ast : a tree representation of the original query maybe?
    • :path : not sure yet
    • :target : not sure what this is yet
    • :query/root : not sure yet

    The env map might also contain other values added by read or mutate as necessary.

    Test the parser like so; app-state should be a atom:

    (parser {:state app-state} [{:widget/people [:person/name]}])