Miroslav Jonaš

Hello generics, goodbye boilerplate!

Are you spending more time on code ceremony than business logic? Learn how TypeScript generics can eliminate boilerplate and let you focus on what truly matters.

Hello generics, goodbye boilerplate!
#1about 5 minutes

Understanding the prevalence of boilerplate in enterprise code

Boilerplate code is common in large, well-architected applications due to consistent patterns, but it can be significantly reduced.

#2about 5 minutes

Explaining the core concepts of Redux state management

The Redux pattern uses a central store, actions, reducers, and effects to manage application state predictably.

#3about 4 minutes

Walking through a typical asynchronous data-loading flow

An example application demonstrates the sequence of actions and state changes for both successful data fetching and error handling.

#4about 9 minutes

Introducing TypeScript generics to reduce action boilerplate

TypeScript generics allow for creating reusable, type-safe constructs like a base action class to eliminate repetitive code.

#5about 7 minutes

Creating a generic reducer to handle common state changes

A custom `createGroupReducer` function uses generics to automatically handle loading, success, and failure states for actions.

#6about 6 minutes

Abstracting NGRX effects using generic helper functions

Generic creator functions like `createSwitchMapEffect` can encapsulate the common logic of listening for an action and handling API call results.

#7about 3 minutes

Using generics for common data structures like pagination

A generic `Pageable` class can standardize the structure for paginated API responses across an entire application.

#8about 1 minute

Adopting a generic-first mindset to improve code quality

Consistently applying generics helps you see code duplication as an opportunity to create powerful, reusable abstractions.

Related jobs
Jobs that call for the skills explored in this talk.

Angular Developer

Picnic Technologies B.V.
Amsterdam, Netherlands

Intermediate
Senior

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
JavaScript is the backbone of web development, powering everything from small websites to large-scale enterprise applications. However, as projects grow in complexity, maintaining JavaScript code can become increasingly difficult. This is where TypeS...
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
BR
Benjamin Ruschin
The HTML Elements That You’re Probably Over-Engineering
As frameworks have become more and more commonplace in the world of web development, so too has the over-engineering of features made possible by our humble old friend, HTML. The mental models that come with using state management in React, Vue and o...
The HTML Elements That You’re Probably Over-Engineering
DC
Daniel Cranney
How to Avoid Over-Engineering
In today’s software development world, the demand for designing applications that are both robust and easy to maintain is more pressing than ever. Many developers encounter the architectural chaos left behind in older codebases, leading to frustratio...
How to Avoid Over-Engineering
DC
Daniel Cranney
Dev Digest 195: End of Likes, JavaScript’s a Zoo, and Messing with Bots!
Inside last week’s Dev Digest 195 . 👎 No more external likes 🤗 Needy programs 📉 The worst selling Microsoft product 🟨 JavaScript engines zoo 🍞 No more toasts! 🤖 Messing with bots 👔 Beware of fake job interviews 🗞️ Join over 150,000 developers alread...
Dev Digest 195: End of Likes, JavaScript’s a Zoo, and Messing with Bots!

From learning to earning

Jobs that call for the skills explored in this talk.