Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
hoplon
Simple and powerful tool for building web apps out of highly composable elements in ClojureScript.
-
electric
a reactive Clojure dialect for web development that uses a compiler to infer the frontend/backend boundary (by hyperfiddle)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
An aspect that flex has that is important when using it with UI frameworks is the ability to control when to start listening to something and when something updates. This is why it differentiates between "signals," which are pure calculations that are inert unless actively being listened to, and "effects" which do side effects and can be started/stopped. In React and other GUI frameworks, you need to be able to abide by the lifecycle of the framework, which means you may need to wait to start running updates until the component your effect is used in has actually appeared in the UI. This is provided by effect and listen returning a function that, when called, starts listening and calling the return value of that stops. Javelin does not give you quite this much control; defc= is eager and will start listening and updating immediately. See https://github.com/hoplon/javelin/issues/27 for their discussion about this very topic.
The subscriptions library is designed to delegate to reagent and has a clojure implementation here which is not reactive right now. It should be straightforward to substitute in the posh implementation in that namespace and achieve parity with cljs. There are already working test cases in clojure for computing derived values here. If you want to take a shot at that I would welcome a PR :D
What you want to achieve is called Incremental Computations. And clojure have a cool framework https://hoplon.io. And part of that framework is https://github.com/hoplon/javelin library, doing exactly what you want
https://github.com/lilactown/flex is a reactive, incremental computation library I've written very much inspired by reagent (which re-frame builds on top of for its subscription). It is pure CLJC, working on both CLJS and CLJC.
Something like data science I think is more similar to a GUI than a microservice. Something like observablehq has already proven that this model works very well for notebooks. Incremental, one of the grandaddies of many reactive libraries and frameworks these days, was similarly developed in the context of doing data analysis and then extended into GUI programming.