This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-15
Channels
- # aws-lambda (3)
- # beginners (17)
- # boot (65)
- # cider (3)
- # cljs-dev (7)
- # cljsrn (82)
- # clojure (82)
- # clojure-italy (1)
- # clojure-russia (25)
- # clojure-spec (56)
- # clojure-uk (5)
- # clojurescript (52)
- # css (2)
- # datomic (6)
- # emacs (1)
- # hoplon (9)
- # jobs-discuss (5)
- # leiningen (8)
- # mount (2)
- # nginx (1)
- # off-topic (2)
- # om (1)
- # om-next (9)
- # perun (13)
- # portland-or (1)
- # re-frame (13)
- # reagent (20)
- # remote-jobs (2)
- # ring (5)
- # spacemacs (1)
- # specter (10)
- # untangled (5)
- # yada (6)
Hello,
so i have this use case where i need to coordinate two http calls. I’m thinking re-frame/reg-event-fx
would be a good solution but i would love to see an example of one so i can wrap my mind around it.
From the looks of:
https://github.com/Day8/re-frame/wiki/Effectful-Event-Handlers
This is what I need:
(reg-event
:my-event
(fn [db [_ a]]
{:http {:method :get
:url ""
:on-success [:process-blah-response]
:on-fail [:failed-blah]}
:db (assoc db :flag true)}))
i guess my question is how do i turn ☝️:skin-tone-5: into a reg-event-fx
@dviramontes Your link is from the old documentation (it says so on the top of the page). I'd suggest looking at the corresponding one in the new docs: https://github.com/Day8/re-frame/blob/master/docs/EffectfulHandlers.md :)
Perhaps also https://github.com/Day8/re-frame/blob/master/docs/Talking-To-Servers.md
I personally prefer to make my own effect handler for my api calls with reg-fx
, but that's just that, a preference :)
https://github.com/Dexterminator/imperimetric/blob/master/src/cljs/imperimetric/handlers.cljs#L130
@edwthomas Interested in updating that gist so that the charts can be dynamically updated with new data?
Hi all. Sorry for reposting in here and #cljsrn but it's really an overlapping question.
I'm playing with re-frame using re-natal / React Native and have hit a concern that I've not hit when using re-frame in a typical web app... The need to persist app-db between application restarts. Obviously a mobile app will need to retain state after closing down. Are there any typical patterns for keeping app-db in sync with for example localstorage?
@paulspencerwilliams the todomvc example has to keep the todos in localstore. I'd start there.
Just to be clear, I mean: see /examples/todomvc/src/todomvc/events.cljs
in the repo. Look for the ->local-store
interceptor and its use.
@brthrjon from the looks of it :v-scroll :on
would do the tirick. Have you looked at the docs at http://re-demo.s3-website-ap-southeast-2.amazonaws.com/#/scroller