refactor: use nullish coalescing & optional chaining #195
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/use-null-coalesce-etc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changes several places to use the afforementioned constructs in favour of ternary expressions.
@ -13,3 +13,3 @@
export function getScrollPosition(el: Element | null): number {
const container = getScrollContainer(el);
return container == null ? window.scrollY : container.scrollTop;
return container.?scrollTop ?? window.scrollY;
I think this is a typo. Should be:
eba9d9cc0f
to808c43377e