Giter VIP home page Giter VIP logo

Comments (4)

mike-thompson-day8 avatar mike-thompson-day8 commented on June 30, 2024

Indeed, it would be simple, which is tempting. But I'm slightly cautious.

core.async/put! itself only allows you to put one thing at a time, and there's a reason for that - you want your API to be the simplest thing possible, while still facilitating the more complex things.

from re-frame.

jamieorc avatar jamieorc commented on June 30, 2024

Only one thing is being put! at a time, unless I misunderstand something.

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on June 30, 2024

I'm pointing out that put! doesn't support multiple additions in one go. Instead put! provides the minimal API and then lets you build more complicated things on top (eg, multiple puts). And I'm suggesting that dispatch should be minimal in the same way.

There's a another, more subtle, reason I'm resisting this. I wonder if one day we'll actually want to add new, optional parameters to dispatch after the event. Additional flags. I wouldn't want to cut off that possibility for the moment.

So I'm going to say no to this for the moment. I'm hoping that your use-case can be satisfied by a emit-n function like this which is a part of your own app:

(defn emit-n 
  [& event-vs]
  (doall (map dispatch (remove nil? event-vs)))
  nil)

from re-frame.

jamieorc avatar jamieorc commented on June 30, 2024

Actually, the second reason makes a lot more sense to me. If you think the api could change, then you don't want to change it up. Cheers.

from re-frame.

Related Issues (20)

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.