re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
uosl 2020-10-22T12:36:35.214800Z

I've often seen it recommended to separate code that updates/gets app-db, into their own functions so they can be re-used instead of encoding the same app-db path into many different event handlers. Has anyone come up with a good name for this? I have separate namespaces for events and subs, and I'm considering putting these functions into their own namespace if I find a good name.

uosl 2020-10-22T12:39:44.216100Z

Right now I'm considering crud. I think our subs and effect handlers would be much cleaner if we had an own crud namespace for every subpart of app-db.

Oliver George 2020-10-22T22:01:44.222200Z

Today I'm in a hammock considering if statecharts-clj can improve the maintainablilty of my re-frame app.  Seems like it could orchestrate but there's some friction in fitting with the re-frame event loop. Love @wxitb2017's work (especially after discovering the :exec false flag). Gist with a https://gist.github.com/olivergeorge/29f189ab794527c3692e3160b0232246#file-authfsm-clj-L39.  Need to flesh it out.  Love how easy the machine is to reason about.

1👍
Lucy Wang 2020-10-23T08:06:13.225600Z

there is a #statecharts channel for discussing fsm related topics

Oliver George 2020-10-24T01:22:24.229500Z

I'd be interested to see some code doing some bootstrapping stuff. It's not immediately obvious how to do a re-frame async flow seen-all-of? check for multiple independent loading actions. For example, I considered how this might translate...

(defn bootstrap
  [{:keys [db]}]
  (let []
    {:db {:ddb/state    data/empty-db
          :app/loading? true
          :app/online?  false}
     :fx [[:dispatch [::init-db]]
          [:dispatch [::init-outbox]]
          [:dispatch [::init-netinfo]]
          [:dispatch [::init-appstate]]
          [:dispatch [::load-token]]
          [:dispatch-later [{:ms 5000 :dispatch [::bootstrap.timeout]}]]
          [:async-flow {:id    ::bootstrap-flow
                        :rules [{:when     :seen?
                                 :events   [::init-db.resolve]
                                 :dispatch [::load-datoms]}
                                {:when     :seen?
                                 :events   [::load-datoms.resolve]
                                 :dispatch [::init-sentry]}
                                {:when     :seen-all-of?
                                 :events   [::netinfo-connection-status-update
                                            ::load-datoms.resolve
                                            ::load-token.resolve
                                            ::init-outbox.resolve
                                            ::init-sentry.resolve]
                                 :dispatch [::bootstrap.succeeded]
                                 :halt?    true}
                                {:when     :seen-any-of?
                                 :events   [::log-exception ::report-anomaly-to-user ::bootstrap.timeout]
                                 :dispatch [::bootstrap.failed]
                                 :halt?    true}]}]]}))

Александр Стоянов 2020-10-22T23:59:20.223800Z

Hello! Maybe its a frequent question but how can i run backend in re-frame template?

Endre Bakken Stovner 2020-10-23T18:47:50.228800Z

What re-frame template are you referring to?

Александр Стоянов 2020-10-23T19:13:05.229Z

lein re-frame

Endre Bakken Stovner 2020-10-23T20:01:03.229200Z

This link says lein watch: https://github.com/day8/re-frame-template#run-application I am used to lein run myself.