Skip to content

Instantly share code, notes, and snippets.

View Lori-Becker's full-sized avatar

Lori Becker Lori-Becker

  • Clutch
  • Ambler, PA
View GitHub Profile
@Lori-Becker
Lori-Becker / datagrid.test.tsx
Created May 11, 2023 16:22
TS Version of mocking ResizeObserver
type ResizeObserverMockCallback = (entries: ResizeObserverEntry[]) => void;
interface IResizeObserverMock {
observe: (target: Element) => void;
disconnect: () => void;
unobserve: (target: Element) => void;
}
function ResizeObserverMock(callback: ResizeObserverMockCallback): IResizeObserverMock {
let timeout: ReturnType<typeof setTimeout>;