#Leveraging Reflux (flux) with React like a pro My latest project for a well known clothing retailer has involved writing a React based web app. It has a staggering amount of data that needs to update different parts of the app. To accomplish this, we are using React (of course) and Reflux. So you’ve heard React is the new hotness that all the cool developers are adding to their resume.
A project I’m currently work on (for a very popular apparel company) is employing AngularJS for their site. I’ve created some directives to handle collecting addresses for billing and shipping. Reusable directives with their own isolate scope. To add more awesome to the mix, I’m using ngMessage to show various error messages with the form. This all works great, but the problem was showing the error messages correctly when there are two forms on the page.
Every project tends toward insanity, it’s your job to Keep it Sane, Stupid. This is the first in a multipart series on Node.js concepts that I consider to be essential to writing sane web apps. You already know how to Node and now it’s time to get serious about building apps. The problem you’ll run into every growing project is complexity. These concepts will help you keep things sane.
Here I want to go through some casting tricks that can be used for better data manipulation. Booleans Build in Boolean() The easiest way is to use the builtin Boolean() method. Boolean('true');// true Boolean(1);// true Boolean('false');// true !!!!GOTCHA!!!!! Boolean(0);// false // Careful Boolean();// true Double Negative This will cast anything as either true or false, there are of course a few quirks that may not be obvious. // FALSE !