Never miss a beat

Join my newsletter.

Tag: javascript

Understanding React Lifecycle Methods

Published: 2/5/2020

React Lifecycle Methods are one tricky piece of business, especially if you’re coming from a framework that doesn’t have their own. Thankfully, they’re fairly similar to Android’s lifecycle methods and it wasn’t long before I was able to grasp them. React has changed a lot over the past few years and it’s lifecycle methods are no exceptions. In fact, with the release of hooks, the idea of lifecycles were shaken once more! React hooks can often be seen as a way to simplify the lifecycle process…

Fetching Data with React Hooks

Published: 1/9/2020

React hooks have changed the way that I (and arguably the React Community) prefer to build components . I’ve been working on a GraphQL project for a while, and when we migrated to functional components and hooks, I was able to use Apollo’s hooks for my data fetching needs. However, I find myself now working on a new project that doesn’t use GraphQL. Consequentially, I find myself wondering “How do I fetch data with React Hooks?” If you’d just like to see a codepen example of the code, you can…

A Quick Script to Update All of Your NPM Dependencies

Published: 3/21/2018

Nothing crazy here, I've just found myself chaining together pipes for something that I feel should ship with NPM. You can use this script to update all of your outdated dependencies to the latest. This is something you'll want to do cautiously, definitely don't run this and commit it without testing. However, if you have a pretty solid test suite, you can integrate something like this into your CI pipeline and fix forward should you find any issues.

A brief summary on Automated Testing

Published: 8/20/2016

I recently read this amazing article by Josh Mock and felt the need to share it. In fact, the tools he uses in his examples – JavaScript, Mocha+Chai, and Phantom are the tools I use daily to do the same thing. I can’t stress enough how great his article is, especially if you’ve written some tests before but you’re not sure how to write a good test. That being said, there’s a few more things I’d like to cover and add to it. In summary, Josh covers the following things: Keep Business and…

JavaScript: Generators

Published: 7/19/2016

One thing I’ve learned recently from Clojure (don’t worry, this post is about JavaScript) is that laziness is great. Lazy code is powerful code, allowing you to model things like infinite sequences or complex computations over a range of data. Without this laziness, an infinite sequence would cause a stack overflow or complex computations would bog down your performance when you may not even need to perform all those computations to begin with! Enter Generators With the latest rendition of…

A Brief Comparison of FlowRouter and Iron:Router for Meteor.js

Published: 9/11/2015

Recently, I was updating an open source package that I maintain – a project structure scaffolding tool . While updating the template I use for my Meteor apps, I realized my tool was still catering towards Iron:Router. For those unaware, Iron:Router has a history of being the Router for Meteor apps. When I first used it, however, it felt like it was lacking in some ways. After using it on about several Meteor apps now, I’ve adjusted my design to conform to Iron:Router and it works extremely…