Skip to content

Instantly share code, notes, and snippets.

View eneajaho's full-sized avatar
🏠
Working from home

Enea Jahollari eneajaho

🏠
Working from home
View GitHub Profile
@eneajaho
eneajaho / what-forces-layout.md
Created October 25, 2023 08:01 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@eneajaho
eneajaho / nx-structure-angular-nestjs.md
Created March 3, 2022 14:30 — forked from trungvose/nx-structure-angular-nestjs.md
Nx workspace structure for NestJS and Angular

Nx

https://nx.dev/

Nx is a suite of powerful, extensible dev tools to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, caching, dependency management, and more.

It has first-class support for many frontend and backend technologies, so its documentation comes in multiple flavours.

Principles

@eneajaho
eneajaho / click-outside.directive.ts
Created January 26, 2022 16:13 — forked from rob-balfre/click-outside.directive.ts
Angular Click Outside Directive
import { Directive, ElementRef, Output, EventEmitter, HostListener } from '@angular/core';
@Directive({
selector: '[appClickOutside]'
})
export class ClickOutsideDirective {
@Output() appClickOutside: EventEmitter<any> = new EventEmitter();
constructor(private _elementRef: ElementRef) {
}