This post will help you understand how to use debounce technique to control how many times a function is executed within a given time frame. Specifically, if that function is a callback to a user event, then there are nuances to make note of in that specific scenario.
We will unfold
debounce as a concept and then illustrate its usage in various contexts of a React application as follows:
In each of the scenarios, we will walk-through working code…
Message grouping and deduplication using SQS and Ruby
In this article, let’s try to design a specific event-based queuing architecture. We will use the term event or message interchangeably through the post.
We are trying to build a user analytics system where every user action must be tracked and stored for later reporting and behavioral analysis. Let’s think of something similar to Google analytics or Segment that we are building in-house.
user_idand that will help us identify the user across the board
This post will try to summarize the most important features you should be taking advantage of. We will highlight features from the following recent releases:
The core design aspect of libraries like Lodash or Underscore.js is
functional programming where you have pure functions that have no side-effects or do not mutate state. Well, the formal definition follows below…
There are many ways to explain functional programming as a concept, but the definition below is succinct:
Functional programming is a style of programming which models…
This post is a compilation of UI interfaces that you can build using just standard HTML elements and CSS support offered by most browsers.
To make it easy for you to follow, each section starts with the HTML snippet that is being discussed, sample screenshots of the corresponding rendering of the code and a codepen link to actual working code that you can play with.
Tip: Use Bit to easily share and reuse components across projects. It’s the fastest way to make components available between teams and apps. Try it.
Most business users are adept at analyzing facts on spreadsheets. Give them a ton of data points in an Excel sheet or Google Spreadsheet, they will be able to formulate Pivot tables, VLOOKUP functions and generate fancy visualizations to make the data palatable and ready for interpretation. Most startups depend on a folder of such spreadsheets to draw their weekly/monthly metrics before moving on to sophisticated Analytics tools.
But, the source of that data is mostly residing in some form of RDBMS or NoSQL database. We depend on various Data Warehousing solutions to import this data and run analysis reports…
From the React docs, the general consensus when it comes to Props vs State is as follows:
Props: (short for properties) are a Component’s configuration. They are received from above and immutable.
State: starts with a default value when a Component mounts and then suffers from mutations in time. It is not advisable to store anything in a state that can be derived from props at any point in time
Useful tip: Bit helps your team collaborate on shared components. Each component can be independently developed, tested and used across your apps…
Have you ever had the feeling that your react component test code is just testing the UI framework and component coupling, but is no where close to mimicking the actual user behavior. If you are with me on that, read further to get introduced to another way of testing components using a library called react-testing-library.
The library was conceptualized by the awesome Kent C. Dodds and I like the guiding principle for creating it:
The more your tests resemble the way your software is used, the more confidence they can give you.
Let’s learn how the testing library helps us…
This post is a compilation of opinionated technical decisions related to building an auto-suggest search widget with the following requirements:
There are two parts to building this Autocomplete widget. …
Higher order components (HOC) are a great pattern to pull-up reusable code across components to a higher level and reuse it wherever needed. Quoting the purpose of HOC from the React official docs:
A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per se. They are a pattern that emerges from React’s compositional nature.
Concretely, a higher-order component is a function that takes a component and returns a new component.
As such, HOCs are a great way to leverage React’s compositional nature to avoid duplicate code and…