Skip to content

Instantly share code, notes, and snippets.

View alx8437's full-sized avatar
πŸ‘¨β€πŸ’»

Aleksandr alx8437

πŸ‘¨β€πŸ’»
View GitHub Profile
let arr1 = [
{id: "pduutGbL2-M", isChecked: true},
{id: "J6MJPuJiDPo", isChecked: true}
]
let arr2 = [
{id: "pduutGbL2-M", isChecked: false},
{id: "J6MJPuJiDPo", isChecked: false},
{id: "WD6jyaFrVM8", isChecked: false},
{id: "ULP07chR5EQ", isChecked: false}
// Listen scroll
@HostListener('window:scroll', ['$event'])
test() {
let pos: number = document.documentElement.scrollTop + document.documentElement.offsetHeight;
let max: number = document.documentElement.scrollHeight;
if ((max - pos) < 200) {
selectedColor: FormControl = new FormControl({value: '', disabled: true});
(value !== '') ? this.selectedColor.enable() : this.selectedColor.disable();
const [containerHeight, setContainerHeight] = useState<number>(0);
const containerHeightRef = useCallback((node) => {
if (node !== null) {
setContainerHeight(node.getBoundingClientRect().height);
}
}, []);
<div ref={containerHeightRef}></div>
const actualSymbolsFromStore: Symbol[] = yield select(SymbolSelectors.byServerIdPresetId(serverId, presetId));
const oldSymbolsFromModelTypes: Symbol[] = modelTypes[0].symbols;
// Change order
const takeActualSymbols: Symbol[] = actualSymbolsFromStore.filter((actualSymbol) =>
oldSymbolsFromModelTypes.find((oldSymbol) => actualSymbol.id === oldSymbol.id),
);
or
https://github.com/welldone-software/why-did-you-render