Skip to content

Instantly share code, notes, and snippets.

@tolumide-ng
Last active January 20, 2021 16:27
Show Gist options
  • Save tolumide-ng/f4ec68ebdd45a0e3bcc74d8db4d77006 to your computer and use it in GitHub Desktop.
Save tolumide-ng/f4ec68ebdd45a0e3bcc74d8db4d77006 to your computer and use it in GitHub Desktop.

Revisions

  1. tolumide-ng revised this gist Jan 20, 2021. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion useIntersectionObserver_0.tsx
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,6 @@ interface entryDef {
    }

    interface IntersectionObserverDef {
    targetElem?: Element,
    ancestorElem?: Element,
    }

  2. tolumide-ng created this gist Jan 20, 2021.
    13 changes: 13 additions & 0 deletions useIntersectionObserver_0.tsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import * as React from "react";
    interface entryDef {
    isIntersecting: Boolean;
    intersectionRatio: number;
    }

    interface IntersectionObserverDef {
    targetElem?: Element,
    ancestorElem?: Element,
    }

    export const useIntersectionObserver = (props: IntersectionObserverDef) => {}