Fork me on GitHub
#re-frame
<
2019-02-19
>
danielcompton08:02:30

This is the last version that supports React 15/Reagent 0.7.0 and below. 0.4.0 will only support React 16/Reagent 0.8.0 and up

ivermac12:02:52

Hi there! We are using the re-frame-http-fx library to make xhr requests to an api server. Is there a way we can test our event handler, that uses the re-frame/reg-event-fx effect, by mocking the calls to the api server rather make the actual calls? We'd like to be able to run tests, especially the async ones that make xhr calls, even when we don't have connection to the internet. Any form of help will highly be appreciated.

jlmr12:02:40

Hi! I’m setting up a new project using shadow-cljs and Electron and am using re-frame-10x. When starting the app, the 10x panel opens, but it only shows the first epoch. I can see in the console log that at least one other event has occured, but it is not visible in 10x. What could be wrong?

danielneal15:02:18

@mark.ekisa_slack_cloj, in your tests, don't require re-frame-http-fx, and instead (reg-fx :http-xhrio (fn [cofx opts] ... your mock implementation )

danielneal15:02:26

your mock can then dispatch on-success and on-failure as needed

ivermac17:02:52

Thanks alot @danieleneal, I hadn't thought of that. I'll give a try.

andrea.crotti20:02:53

Yes we do the same and it works

andrea.crotti20:02:47

I also made it a test fixture (with a global atom keeping track of the calls to it) so it's easier to use in tests

👍 5
Nolan23:02:30

hi all, the re-frame-10x dev tools are not working for me, more specifically they do not seem to be responding to my "C-h" input

Nolan23:02:44

here is my project.clj

(defproject personal-web "0.1.0-SNAPSHOT"
  :min-lein-version "2.5.3" ;; needed for bidi
  :source-paths ["src/main/cljs"]
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [org.clojure/clojurescript "1.10.516"]
                 [reagent "0.8.1"]
                 [re-frame "0.10.6"]
                 [bidi "2.1.5"]
                 [venantius/accountant "0.2.4"]
                 [org.roman01la/cljss "1.6.3"]]
  :aliases {"fig"       ;; launch figwheel REPL
            ["trampoline" "run" "-m" "figwheel.main"]
            "fig:build" ;; launch figwheel REPL using dev profile
            ["trampoline" "run" "-m" "figwheel.main" "-b" "dev" "-r"]
            "fig:min"   ;; minify project according to dev profile
            ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
  :profiles {:dev
             {:dependencies
              [[com.bhauman/figwheel-main "0.2.0"]
               [com.bhauman/rebel-readline-cljs "0.1.4"]
               [binaryage/devtools "0.9.10"]
               [day8.re-frame/re-frame-10x "0.3.7-react16"]]
              :source-paths   ["src/main/clj"]
              :main           "personal-web.core"
              :resource-paths ["target"]
              :clean-targets  ^{:protect false} ["target"]
              :compiler       {:closure-defines
                               {"re_frame.trace.trace_enabled_QMARK_" true}
                               :preloads
                               [devtools.preload
                                day8.re-frame-10x.preload]}}})

Nolan23:02:23

and yes i am certain the focus is not in a text input when i enter "C-h"

danielcompton23:02:51

What happens instead?

Nolan23:02:37

@danielcompton platform? mac/osx, google chrome - latest version (i think)