When I discovered Clojurescript and started to play around with it, the first library that I used was Reagent. Essentially, it’s a wrapper around Re

/ The missing re-frame quick start (with tutorial)

submited by
Style Pass
2023-03-18 02:30:05

When I discovered Clojurescript and started to play around with it, the first library that I used was Reagent. Essentially, it’s a wrapper around React, allowing us to write components as Clojurescript functions and instead of JSX, using vectors and keywords1 for the syntax. It has been pretty easy to start with, since I already known how React works and I was comfortable with the Clojure syntax. Like its parent library, it’s basically offers a way to define reusable component, with internal state and props received from the parent components.

Since React and Reagent are UI libraries, the application state management is left to the programmer, and that’s where something like re-frame comes handy. It implements a model, view, update paradigm using Reagent under the hood, and help separating the state management (model, update) from the UI components (view). The library is similar to Redux having a single central store for state and unidirectional data flow.

The problem I found with re-frame, although it’s actually a simple library, is that the documentation doesn’t provide a quick start page like Reagent. Instead, it only offers a long, detailed explanation (which is still a recommended reading for fully comprehend how to architecture large apps). If you’re already familiar with similar paradigms, a quick guide would be enough to get started with it.

Leave a Comment
Related Posts