shlogg · Early preview
Eduard Krivanek @krivanek06

Angular Local Storage Service With TypeScript

Create a strongly typed service for managing application state in Angular projects with local storage synchronization using generics and signals.

When manage application state in you Angular projects, you create a service to handle a specific feature state, such as booking state, user state, groups, etc.
However there are cases where you have such a little data that it’s not worth creating a separate service, but rather have one service where you keep some general application information, and maybe synchronize with local storage.
You want to have a strongly typed service where you can save pieces of data under specific keys and sync it with local storage, so how to go around it? First create you types and initial late:

export type Loca...