Jul 15, 2022

Prevent Unnecessary Rendering When Using React Hooks

When working with state hooks like useReducer or useState or useContext, it can become expensive to render components. If we let the framework handle rendering, all components and children components will be rendered if the parent uses state or context hooks or an action is dispatch into the reducer hook. Today we will look at optimisation to stop the rendering propagation for components which do not need to be rendered.

Typescript React

May 06, 2022

Apollo Client Fetch Policy

Last week we looked at Apollo Client and how it could be used to manage queries to GraphQL server. In today’s post, we’ll look at the different fetching policies provided to manage query data and caching.

Typescript GraphQL React

Apr 29, 2022

Query Graphql With Apollo Client React

Apollo client allows us to easily manage our GraphQL queries and data from the clientside. It provides functionalities such as caching, loading state and data propagation to components and most importantly; is compatible with all major UI frameworks. In today’s post, we’ll look at how we can simply hook Apollo client in a React application and use it to query our GraphQL server.

Typescript GraphQL React

Apr 22, 2022

Common Table Expression In Postgres

Common table expression, also called WITH queries, can be used to create auxiliary queries that can be used in larger queries. They can be used to breakdown complex queries into multiple simpler queries which are then used in a primary statement or they can also be used to write recursive queries. In today’s post, we will look at how to define CTE with examples in Postgres.

PostgreSQL

Apr 15, 2022

React Reducer Hook

useReducer hook in React allows us to manage state in a redux manner. This is useful for handling complex state in a single object, as opposed to useState which is better used with single variable state. With useReducer, we can define a reducer, a set of actions to interact with the state and use a dispatcher to dispatch the actions from our component. In today’s post we will look at how we can use useReducer with example.

React Typescript

Apr 08, 2022

React Memo Hook

useMemo hook in React can be used to memoize values. Memoization is used as an optimization by caching previous result of computation and directly returning the result when teh same inputs are requested. In today’s post, we’ll look at how we can use useMemo.

React Typescript

Apr 01, 2022

React Callback Hook

Callback hook in React can be used to memoized a callback function to skip unnecessary rendering. In today’s post we will see why we would useCallback hook.

React Typescript

Mar 25, 2022

React Ref Hook

Ref hook in React can be used to keep a mutable reference across multiple renders. In today’s post we will see how we can use useRef hook and when they are useful.

React Typescript

Mar 18, 2022

React Context Hook

Context hook in React can be used to manage global state. In today’s post we will see how we can use useContext hook and how we can pair it with useState to provide a global state to all children components.

React Typescript

Mar 11, 2022

React Effect Hook

When using React hooks, we often come across scenarios where we need to perform side effects. For that, a built-in hook is in our disposal; useEffect. In today’s post, we’ll look at how to use useEffect hook and in which context it should be used.

React Typescript

Mar 04, 2022

Smart Contract Development With Brownie

Few months ago we looked at how we could use web3.py to directly compile Solidity contracts and deploy them on a local ganache-cli blockchain. Although that’s a possible way of deploying smart contracts, it wouldn’t be a recommended way to manage production grade contracts. For that, we would be delegating the steps to a development and testing framework for smart contracts. Such environment provides us an easy way to manage project of smart contracts, manage dependencies, and test our smart contracts. In today’s post, we will look at Brownie, a Python-based development and testing framework for EVM smart contracts

Ethereum Solidity Python

Feb 25, 2022

Setup Local Development Blockchain With Ganache

Ganache is a local blockchain which allows us to develop and test smart contract easily. In today’s post, we will look at how we can start a development Ethereum blockchain in few clicks, and we will look at the feature provided by Ganache.

Metamask

Feb 18, 2022

Dbeaver Auto Commit And Manual Commit

When using DBeaver, we can choose betweeen using auto commit or manual commit modes when executing SQL scripts. In today’s post, we will look at how we can switch between the two and how transactions can be managed.

DBeaver

Feb 11, 2022

Exhaustiveness Checking In Typescript

Last week we talked about type predicate allowing us to narrow down based a variable based on a predicate function. In today’s post, we’ll continue to explore some of the narrowing functionalities of Typescript by looking at discriminated union narrowing and exhaustiveness checking.

Typescript

Feb 04, 2022

Type Predicate In Typescript

Type predicate in Typescript allows us to narrow down the type of a variable using a predicate. Today we’ll look at how to use type predicates, and show examples where they are useful.

Typescript