GithubHelp home page GithubHelp logo

Comments (3)

ertugrulcetin avatar ertugrulcetin commented on May 10, 2024

Thanks for reaching out @CalebMacdonaldBlack. What is the exact error are you getting? Also, could you send your code snippet that causes the error? I tried passing nil to dispatch-n and did not get any errors;

(reg-event-fx
  ::call-some-stuff
  (fn [{:keys [db]} _]
    {:dispatch-n nil}))

Also, the code ignores if the dispatch-n is nil: https://github.com/ertugrulcetin/re-frame-flow/blob/master/src/re_frame_flow/core.cljc#L27

So nil shouldn't pass these functions, I need more info about this one.

from re-frame-flow.

CalebMacdonaldBlack avatar CalebMacdonaldBlack commented on May 10, 2024

Hi @ertugrulcetin. I love your project! Thank you for making it.

the dispatch-n takes a vector. Run this and you should see the error in your console:

(rf/reg-event-fx
  :foo
  (fn [_ _]
    {:dispatch-n [nil]}))

(rf/dispatch [:foo])

Here's the stack trace though:

router.cljc:204 Uncaught Error: Doesn't support name: 
    at Object.cljs$core$name [as name] (core.cljs:9500)
    at Object.re_frame_flow$core$kw__GT_str [as kw__GT_str] (core.cljc:57)
    at re_frame_flow$core$id__GT_node (core.cljc:68)
    at eval (core.cljs:4712)
    at eval (core.cljs:4712)
    at Object.eval [as sval] (core.cljs:3415)
    at Object.eval [as cljs$core$ISeqable$_seq$arity$1] (core.cljs:3472)
    at Object.cljs$core$seq [as seq] (core.cljs:1213)
    at eval (core.cljs:3770)
    at Object.eval [as sval] (core.cljs:3415)

The event key is nil and name cannot accept nil as a value. Re-frame deals with nil values here by filtering them out before dispatching them.

from re-frame-flow.

ertugrulcetin avatar ertugrulcetin commented on May 10, 2024

@CalebMacdonaldBlack thank you for the detailed explanation. I fixed it and released a new version "0.1.3", please try it. If some error occurs, let me know.

from re-frame-flow.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.