re-frame

escherize 2024-06-04T16:59:09.637079Z

Is there prior art for a system to capture effects as data (as re-frame does) but for backend, or more general usecases? I have a sketch written out here, that has a state-modifier, and a log fx handler: https://gist.github.com/escherize/58d09deb1fde49805052b56cc65de27c • verbs are analogous to re-frame events • fx-handlers do the side effecting • the script is a (potentially nested, but here just a sequential) data structure that gets walked by execute, and ends up doing stuff. The thing I want to explore and enable is allowing some higher level programming by letting functions return a series of operations, something like:

[:transaction
  [:insert! :user {:name "bill"}]
  [:update! :last-user (fn [state] {:name "bill" :id (bills-id state})]
  [:query :last-user]]

;;=> [1 1 {:last-user {:name "bill" :id 7}}] ;; or similar

p-himik 2024-06-04T17:29:13.389649Z

Don't remember seeing anything like it. I'd move the question to #clojure because it's not about re-frame itself at all, and there are many more people there that know backend stuff.

1
liebs 2024-06-04T19:22:22.033689Z

Maybe not exactly what you want but this came to mind: https://github.com/yapsterapp/a-frame

👍 1