In React, data flows unidirectionally. This means that the State becomes the source of truth – especially working with controlled components and forms. Having said that, you will see your form HTML riddled with something like: And in your class, something like: This is to enforce this unidirectional pattern, making the state mutable and can […]
Category Archives: JavaScript
JavaScript is considered to be the “language” of the web. It is one of the most expressive object oriented and functional programming available to date. These posts contain topics about JavaScript.
How to create simple Pagination using Lightning components and Apex
Let’s build something every web application needs in their results page: Pagination (aka Paging). This technique is necessary so we don’t bombard our users with all the items in our result page. Instead, we show them in “chunks” or “sets” of results. This is a very simplistic example – all we’re doing is a set […]
How to build an auto-suggest field using React and Express
One of my latest projects is a map application that has a search form in it. In this form is a field where you can type in a few letters and it will bring up the cities in the US, along with the state abbreviation concatenated with it. In other words – an autocomplete field […]
Repeating Inputs in Salesforce Lightning Components
What we’re building: An input field that can be duplicated (repeated) as part of a form. This is particularly useful when you want to capture information that you want to separate in different lines, and you don’t really want to use a textarea. This way, we’re forcing our user’s to enter a value per input. […]
New WordPress Starter Theme using VueJS
I’ve been building WordPress themes for quite some time now. And with the advent of front-end frameworks and WP’s REST API, I thought it would be a good combination to build one that uses both. The benefits would be that the site’s user experience would be lightning fast. There wouldn’t be server page loads (except […]
Easy Form Validation with VueJS + Boostrap
I kept bumping into a wall yesterday trying to figure out how to apply the Bootstrap class “is-invalid” into a form field only on blur and if the value is invalid. The “is-invalid” class applies the styles to the field as well shows the “invalid-feedback” div directly underneath it – for inline error messaging. I’m […]