Search
Run useEffect Only Once
30.7.2019
React has a built-in hook called useEffect. Hooks are used in function components. The Class component comparison to useEffect are the methods componentDidMount, componentDidUpdate, and componentWillUnmount.
useEffect will run when the component renders, which might be more times than you think....
Collective #536
29.7.2019
Ciao * Building Beautiful UIs * Poolside FM * Livewire * Liquidfun * Practical Ways to Write Better JavaScript
Collective #536 was written by Pedro Botelho and published on Codrops
Optional Chaining
29.7.2019
For all of the improvements that the JavaScript language has added over the past few years, like the spread operator, default argument values, and arrow functions, there are still a few features I’d love to see implemented. On such feature is optional chaining. Optional chaining allows...
JavaScript Proxy with Storage
26.7.2019
The JavaScript Proxy API provides a wealth of “magic” within JavaScript, allowing you to use any object as sort of an alias that allows a wall of validation, formatting, and error throwing. Did you know that you could also employ the Proxy API as an abstraction to different types...
Zdog
24.7.2019
David DeSandro has loads of super cool JavaScript libraries he's created over the years. His latest is Zdog, a "round, flat, designer-friendly pseudo-3D engine for canvas & SVG." It's only been about a month since he dropped it (although, like any good library, it's been simmering) and it...
Multi-Line Truncation with Pure CSS
17.7.2019
Truncating a single line of text if is fairly straightforward. Truncating multiple lines is a bit harder. Using just CSS (no JavaScript or server-side dancing) is nice for the simplicity. It's gotten a little easier lately since Firefox (since version 68) has started supporting the ultra-bizarre...
A Peek at New Methods Coming to Promises
16.7.2019
Promises are one of the most celebrated features introduced to JavaScript. Having a native asynchronous artifact baked right into the language has opened up a new era, changing not only how we write code but also setting up the base for other freat APIs — like fetch!
Let's step back a moment...
Finally… A Post on Finally in Promises
16.7.2019
“When does finally fire in a JavaScript promise?” This is a question I was asked in a recent workshop and I thought I’d write up a little post to clear up any confusion.
The answer is, to quote Snape:
...always.
The basic structure is like this:
try {
// I’ll try to execute some code...
Detect Cryptocurrency by Wallet Address
16.7.2019
I’ve always been a massive advocate of cryptocurrency. I love the technology, the ease of use, and the freedom that cryptocurrencies bring to the world. Despite my love of crypto, I know that adoption will take a long time and that the state of crypto is not friendly to new adopters. One scary part...
JavaScript Ternary Operators
12.7.2019
Ternary operators allow us to really quickly write shorter **if
Weekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults Query
11.7.2019
In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties aren't computing hogs, variables defined at the top-level in JavaScript are global to other page scripts, and Babel env now supports the defaults...
Types or Tests: Why Not Both?
10.7.2019
Every now and then, a debate flares up about the value of typed JavaScript. "Just write more tests!" yell some opponents. "Replace unit tests with types!" scream others. Both are right in some ways, and wrong in others. Twitter affords little room for nuance. But in the space of this article we...
The Many Ways to Include CSS in JavaScript Applications
8.7.2019
Welcome to an incredibly controversial topic in the land of front-end development! I’m sure that a majority of you reading this have encountered your fair share of #hotdrama surrounding how CSS should be handled within a JavaScript application.
I want to preface this post with a disclaimer: There...
10 Interesting JavaScript and CSS Libraries for July 2019
8.7.2019
Better vanilla JS syntax, awesome CSS snippets and more cool libraries in our compilation for July 2019
React Starter: How does JSX make HTML elements?
3.7.2019
JSX makes making React components easier. Some may find JSX to have a high learning curve and that's totally understandable. It's not exactly HTML and it's not exactly JavaScript, so it can take so
Exploring Sets and Maps in JavaScript
3.7.2019
Let’s take a look into two new constructs that were introduced in the JavaScript ES6 specification:
Set - The Set object allows you to store unique values of any type
Set Video Playback Speed with JavaScript
2.7.2019
I love that media has moved from custom plugins (Flash…gross) to basic HTML <video> and <audio> elements. Treating these media sources as just another element allows us to use CSS filters to adjust display, for example. The less we need to do with ffmpeg or plugins, the better. I’ve been...
Getting to Know the useReducer React Hook
26.6.2019
useReducer is one of a handful of React hooks that shipped in React 16.7.0. It accepts a reducer function with the application initial state, returns the current application state, then dispatches a function.
Here is an example of how it is used;
const [state, dispatch] = useReducer(reducer...
Getting to Know the useReducer React Hook
26.6.2019
useReducer is one of a handful of React hooks that shipped in React 16.7.0. It accepts a reducer function with the application initial state, returns the current application state, then dispatches a function.
Here is an example of how it is used;
const [state, dispatch] = useReducer(reducer...
ES6 Arrow Functions in JavaScript - Getting Started
25.6.2019
With ES6 JavaScript came many updates to the language including the spread operator, object destructuring, new tpye of variables, and more. On top of all those amazing features came arrow f