This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-30
Channels
- # announcements (1)
- # beginners (113)
- # cljs-dev (5)
- # cljsrn (20)
- # clojure (16)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-spec (17)
- # clojure-uk (5)
- # clojurescript (125)
- # core-async (4)
- # cursive (4)
- # datomic (66)
- # defnpodcast (1)
- # fulcro (25)
- # kaocha (2)
- # klipse (1)
- # nrepl (19)
- # re-frame (5)
- # reagent (3)
- # reitit (6)
- # ring-swagger (16)
- # shadow-cljs (16)
- # sql (6)
- # test-check (1)
- # tools-deps (1)
- # vim (7)
I’m new to re-frame and wonder about best practices for integrating multiple sources of state. Clearly re-frame espouses the theory of “keep it all in the app db” but there are less transient repositories that must be considered -particularly remote servers, URL, LocalStorage, Cookies, etc. What is the best practice for coordinating these repositories? Specifically, state in the URL… is the URL a source of events? Is it a repository of state? Do libs like pushy represent the best practice for managing the URL? Part of the problem I find is that URL changes can be natural (such as at startup of the re-frame app or in response to <a> tags) or un-natural (as a result of some other stimulus).
New release of re-frame-10x out: https://github.com/Day8/re-frame-10x/releases/tag/0.4.0
The latest re-frame works fine with reagent 0.8.N
@cch1 In my applications I typically have a layer that wraps each one of those concerns (localStorage, route state, etc..) that are responsible for injecting and updating the app db. I use pushy and bidi for routing and have a re-frame events and subscriptions that keep my app state up to date. I wrote https://github.com/oconn/re-frame-routing to help with that particular problem. You could probably easily swap bidi out for any of the other routing libs.