The Reader monad and read-only context
A functional approach to building React applications.
Read more →37 posts · All tags
A functional approach to building React applications.
Read more →A functional approach to building React applications.
Read more →In this series we are looking at code organization in the context of a React and Redux application. The takeaways for the "Three Rules" presented here should be applicable to any application, not just React/Redux. Series contents - Part 1 - Three Rules for…
Read more →Dynamically typed languages like JavaScript provide a lot of expressiveness and power to the programmer. By not having to think about strict types, a program is more maleable since it will run no matter what, allowing the programmer to write code very…
Read more →In this series we are looking at code organization in the context of a React and Redux application. The takeaways for the "Three Rules" presented here should be applicable to any application, not just React/Redux. Series contents - Part 1 - Three Rules for…
Read more →In this series we are looking at code organization in the context of a React and Redux application. The takeaways for the "Three Rules" presented here should be applicable to any application, not just React/Redux. Series contents - Part 1 - Three Rules for…
Read more →A little known fact about me is that I took Wing Chun lessons for four months back in 2006. A student starting in Wing Chun will begin by learning the first form, called Siu Lim Tao (小練頭). This form's name translates to "little idea," and it provides the…
Read more →Redux is a Flux-like framework that has exploded in popularity within the React community. It reduces complexity by enforcing a unidirectional data flow, the use of single state atom, and pure reduce functions for state updates. For me, there has always been…
Read more →In programming, indirection is the ability to hold references to something, as opposed to the value itself. In object-oriented programming, indirection is used for dynamic dispatch and delegation). For example, we can use delegation as follows. This allows us…
Read more →The release of TypeSciprt 1.6 includes support for React components. I decided to give it a whirl and see what TypeScript has to offer. The end result is a port of the Redux TodoMVC example to TypeScript. (See my repo on GitHub) So why use types in the first…
Read more →In this post I want to explore the idea of using contexts in React to implement dependency injection (DI) in our application. We'll cover two things: 1. What contexts are in React and how they work 2. Why we care about DI and how we can implement them using…
Read more →If you have not been developing using Flux yet I would strongly urge you to check it out. As I've discussed before, the ideas behind Flux are not new. However, its application to frontend architecture has had a significant impact on developers, myself…
Read more →In this post, I want to explore a different approach to writing directives in Angular 1. As we know, building applications in Angular 2 is going to be different from what we're used to in Angular 1. For example, ng-controller will be gone, and components will…
Read more →In Angular 1, directives are a way for developers to extend HTML. This means introducing new behaviours to the DOM via custom tags or attributes. You can change what a directive matches by using the restrict option. By default it is set to 'EA', meaning it…
Read more →There's been a lot of discussion on what Flux is, the different variations, and how the pattern can be improved upon. I've even blogged about Flux here on this blog! I've been doing a lot of work with React and Flux in the past month. In that time, I learned…
Read more →Flux is an application architecture designed by Facebook for their JavaScript applications. It was first introduced by Facebook in May 2014, and it has since garnered much interest in the JavaScript community. There are several implementations of Flux.…
Read more →JavaScript functions can be confusing sometimes. There are many ways to define them and many ways to invoke them. Throw in this, and things really starts to get fun. In this post we will revisit plain-old functions in JavaScript. The different ways we can…
Read more →Angular 1.3.0 (superluminal-fudge) has been released! In a previous post, I presented a framework on top of AngularJS 1.2 to handle asynchronous form validations and error message display concerns. This has been made much easier in AngularJS 1.3! In this post…
Read more →One of the new features of ECMAScript 2015 are template literals. The simplest use cases for template literals are creating multiline strings, and doing string interpolation. Multiline string: String interpolation: You can also tag template literals by adding…
Read more →Throughout your adventures with Angular, you will undoubtedly come across situations where custom directives make sense. These situations typically involve DOM manipulations, or calling a jQuery plugin. However, there are other cases where you may not…
Read more →AngularJS has been instrumental in changing the way I develop web applications. From building imperative views where both business logic and user interaction live, to separate controllers and directives that handle both requirements respectively. From sharing…
Read more →Just when you think that you're in control, Just when you think that you've got a hold, Just when you get on a roll, Here it goes, here it goes, here it goes again. OK Go - Here It Goes Again And so the evolution of front-end development continues with Gulp,…
Read more →One of the main benefits of Angular is the ability to easily extend HTML with new behaviours through the use of custom directives. Directives allow developers to match markers in the DOM with the intended behaviours. In this post we'll cover: Why writing…
Read more →I'm a big fan of CoffeeScript. It makes working with Backbone.js so much nicer than doing it in VanillaJS. However, one thing I wish CS had was built in support for mixin declarations. There was some discussion on a closed pull request for adding support for…
Read more →I think all JavaScript module writers should start using UMD when defining their modules. Yes, it's a bit messy and seemingly unnecessary boilerplate. But if you really cared about your users, then you'll do it. :) Even if you don't like using an AMD like…
Read more →There is a JS Jabber that came out recently that focused on Backbone.js. The cast featured Jeremy (developer for Backbone.js) and Yehuda (developer for Ember.js), and touches on some interesting points: - Convention over configuration - Opinionated library -…
Read more →I added searching capabilities to this static website. I don't think any website is useful these days without some basic search functionality. I created a Jekyll plugin that will go through the posts and pages, and index them in elasticsearch. You can find…
Read more →Read a really good post on automatic semicolon insertion (ASI) in JavaScript. I highly recommend reading it if you're not familiar with how ASI works. http://inimino.org/inimino/blog/javascriptsemicolons The author even includes the parser expression grammar…
Read more →There are plenty of posts discussing anti-patterns in other languages, like Java or Python . However, I haven’t really seen much regarding JavaScript besides this question on StackOverflow. And most of the ones I found don’t separate the DOM API…
Read more →One of the first things you learn programming in JavaScript is, " Global variables are evil ." This is especially true when writing a JavaScript library, but I'd take that advise even otherwise to avoid unnecessary headaches. As an avid jQuery user, one thing…
Read more →I ran into a problem today where the RIA I'm building works for all browsers except Safari -- specifically Safari 4, not sure about 3. The error happens when a certain page loads, and all I'm greeted with in Safar is SyntaxError: Parser Error. Nice. After a…
Read more →The good thing about JavaScript libraries such as jQuery is that developers can focus on functionality without having to worry too much about cross-browser compatibility. However, often times it is still very useful to know why happens behind the…
Read more →When looping through very large arrays, you may find this tip useful: it's much fast to use a while loop to iterate through an array than a for loop. For example, if you take this code: You can make it run faster by using a while loop instead. This works…
Read more →Update: Feb 1, 2012 I've noticed traffic coming from Google with keywords prevent greasemonkey , so I though I'd give an update on this issue. There has been patches to Greasemonkey since the writing of this post to render everything I talk about here…
Read more →For the last few months I've seen some aggressive campaigning to rid the online world of Internet Explorer 6 . Many web developers and designers have been supporting this browser for what seems like forever, and now that IE6 is losing market shares fast, it…
Read more →Here's an cool post from the Mozilla Developer Center regarding the new <video></video> in Firefox 3.1. The demo featured is a video filmed with a green screen, and the green screen is replaced with an image in real-time using JavaScript. Pretty…
Read more →There are many things that web developers should know about JavaScript, but the most basic of things are anonymous functions and closure . Both are very powerful tools for anyone working with JavaScript. So what's so great about them you ask? Well, I think…
Read more →