Skip to content

Instantly share code, notes, and snippets.

View AlbertoBasalo's full-sized avatar

Alberto Basalo AlbertoBasalo

View GitHub Profile
@AlbertoBasalo
AlbertoBasalo / nx-ng_large.md
Created May 18, 2023 15:38
Nx recipe to generate the scaffolding for a big Angular solution.

Large Ng app with NX

0. Create an empty Nx workspace

npx create-nx-workspace@latest
  --name=your-org-name
  --nxCloud=false
  --preset=apps
@AlbertoBasalo
AlbertoBasalo / ngsw-config.json
Created October 28, 2022 09:18
Angular PWA configuration file
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"appData": {
"version": "1.2.3",
"description": "feat: 🌅 less bugs more features"
},
"assetGroups": [
{
"name": "app",
@AlbertoBasalo
AlbertoBasalo / store.ts
Created October 19, 2022 09:41
A generic class to manage state in an asynchronous way.
import { BehaviorSubject, distinctUntilChanged, map, Observable } from "rxjs";
/**
* A generic class to manage state in an asynchronous way.
*/
class Store<T> {
/**
* @private field to store and notify state changes
* BehaviorSubject is a special type of Observable
* that keeps hold of the current value
@AlbertoBasalo
AlbertoBasalo / eslint.json
Last active September 22, 2022 12:38
ESLint configuration for clean TypeScript
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["prettier", "@typescript-eslint"],
"env": {
@AlbertoBasalo
AlbertoBasalo / settings.json
Created July 21, 2022 10:08
Settings example for 0.0 article
{
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
@AlbertoBasalo
AlbertoBasalo / original-settings.json
Created July 20, 2022 11:37
Full Visual Studio Code settings
{
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},