Hacker Newsnew | past | comments | ask | show | jobs | submit | babbeloski's commentslogin

Question to JS people using Redux. Are the middlewares used to control side effects in actions considered monads? The action returns a description of the side effect, and the middleware handles the actual doing, leaving the programmer to focus on the pure aspects.


Only connecting the root component, fetching the entire state, and passing down all those props manually isn't proper. You shouldn't pass props that can be grabbed directly from the store IMO.


Clojurescript is the most complete to JS languange. The build and developer tools are _ahead_ of Javascript. The language is great too, and it's pretty 1:1 with javascript, plus all the other goodies. It's not going to satisfy haskellers, but when you look at the big picture it wins over Elm (at the moment, I love Elm too)


BFA in Illustration, currently leading the UI team at a 'big data' company in NYC. I'd say what translates from art to tech is the constant spiral of learning and improving. It takes a lot of patience and persistence to learn how to draw and paint. It doesn't come fast, it's years of struggle until your skills converge with your aesthetics. Programming is a lot like that, and it's never ending. You're committed to being a life long observer of what's going on, taking influence from things you like; it's always changing and growing, and that's what keeps it interesting.


Try spacemacs everyone, it's incredible, and the cider repl for clojure is the real deal. I was a long time vim user who tried to switch to emacs for a month but abandoned it for intelli j, and then atom for while. The spacebar mechanism to trigger the top level navigation that you drill into is an amazing mechanism for memorizing key short cuts (or not remembering and being able to use the menu to get what you need). spc p f inside a project has changed my life, I can't go back to a tree directory for navigation. Frees a lot of my working memory up.

Kind of a rant and off topic, but I think it's the bees knees and it's ace for clojure / common lisp / javascript / flow / anything else.


I use Spacemacs for Clojure at the moment and I quite enjoy it. My only problem is there doesn't seem to be a way to insert a newline in the repl without submitting the line for evaluation (I want to be able to structure a function definition for readability, for example, rather than having to have a single huge line).

I did also have to stop smart-parens from auto-closing backticks, but that was a simple fix.


Use C-j to insert a newline in the repl.


Thanks!


> For some people conscious existence is too burdensome, uncomfortable, full of anxiety, outright maddening or some combination thereof.

Reading this gives me immediate anxiety. I have times during the day where just seeing things and being alive is almost unreal, like I can't deal with, and the thought of doing this for N number of years more is overwhelming. As I'm getting older life is just even more surreal, I sometimes wonder if I have the mental fortitude to make it to old age. This isn't a cry for help, you just touched a nerve with that sentence.


Phew, I'm not alone. Word for word, to the letter.


Probably more common than you think.

One old saw has it that when a man is starving he forgets even the urgent promptings of a full bladder. A newer old saw claims that religion is the opiate of the masses (with its uncoined analog regarding fetishism & the ruling classes).

The quoted OP railed against wasted time and effort, but his views on the despiritualization of the modern man are not clear. A non contemporary would likely diagnose a 'spiritual crisis' for the existential angst of the uncommon non-aristocratic unbelieving modern man.


You're not alone. I sometimes wake up at night, with a sudden realization and shock that I am existing.


I cut my teeth on Ember at a marketing company in 2013, and actually found my current job through acquaintances made by attending a weeklong Ember training session in Boston (led by yehuda and tom). It had been a great fit for me at the marketing company because the apps I was developing were more restful oriented crud apps. apps with a lot of routes that were more or less their own thing (not too much shared state).

The company that I joined was using Ember, but their app was more of an analytic dashboard and it didn't really have more than a handful of routes. the amount of views and logic and state that lived on each route / controller was insane. Also, between the few routes you really needed to share state and things got very messy. I'm still with the company today, and the app's routing is still controlled by ember, but we have switched entirely to react + redux and are a lot closer to being off ember completely.

The real boon for us has been the single source of truth and the connect function from react-redux. Basically any component can just declare the data it relies on via store query functions e.g. getLabelsForUser(state, userId), which breaks you free from the uber painful process of passing properties down the entire view tree to child nodes.

I also got a lot better at developing when I started developing for react, because I was no longer writing framework code, I was writing and utilizing my own functions and abstractions.

I'm not saying ember is inferior, but of course there are trade offs to both. I absolutely love yehuda and tom, they are so prolific, but I would be interested in seeing how ember apps fair when there are only a couple of routes but a ton of view logic and state; where does the state live and how is it coordinated. How do you coordinate data across the app hierarchy? Asking because I really failed at that 2 years ago and ended up with a mess, it definitely felt like uncharted territory. Would totally accept developer error.


agreed - checkout the official redux bindings for ember (a cargo cult of the connect api from react-redux)

https://github.com/toranb/ember-redux


React and mobx is like clojurescript's Reagent library, which I think is the next level after react-redux. It's like pseudocode, here's a direct translation of reagent's clock example: https://gist.github.com/lsdafjklsd/096f8657306a86832e6df1109.... This essense lib is just a unified api for mobx and react, I've been using it to teach people javascript. https://github.com/lsdafjklsd/essence


You could reduce the height of the number row by half, add that vertical space to the space bar, and turn the spacebar into 3 parts: regular buttons on the wings where your thumbs rest, and capacitive trackpad in the middle.

Add cellular support and I'll gladly toss my smartphone, which I don't use anyway. I've always just needed a laptop, I'm terrible with touch screens, very painful to use. I would carry this around and have a smart watch for basic text / calling, gps


At work I've started keeping the reducer in the actions file, anyone else do that? This way they can share the same const declarations, and you don't have to toggle between two files when most actions / reducers are pretty small.


Of course: https://github.com/erikras/ducks-modular-redux

The potential reason not to do that is that more than a reducer may listen for a given action, even though I guess it's more an exception than the norm.


https://github.com/loggur/react-redux-provide

This allows you to encapsulate all of your Redux actions/reducers/etc into standalone "providers". It decouples pretty much all of your React components (UI) from your Redux logic (models/controllers), which maximually separates your concerns and makes it trivial to reuse anything anywhere. It also allows you to instantly swap databases and/or websocket implementations.


I originally tried this but then discovered combineReducers() this will allow you to organise your reducers into a single import. I found it a more sane way to organise all of my reducers, as the majority of them were small. Here's a link for API http://redux.js.org/docs/api/combineReducers.html


That would combine your reducers into one. I believe he was referring to putting action creators in the same file as their associated reducers.


It seems that this is also the way of doing things in Elm (from which Redux is inspired): http://guide.elm-lang.org/architecture/index.html . The Update part groups both the definition of the actions and the reducers.


I started doing that pretty soon after starting with Redux, with some other tweaks to make them even more tightly coupled. It worked well for me, but I assume there is a reason not do that. However, I never figured that one out.


I do this as well in small projects, then split it out when things get big (eg; >1000 line file).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: