Skip to content

Instantly share code, notes, and snippets.

@chancity
chancity / useWindowScroll.js
Created October 9, 2020 16:36
React scroll hook
import {useEffect, useState} from 'react';
export const DIRECTION = {
down: 'DOWN',
up: 'UP',
unset: 'UNSET',
};
const getDocumentBoundingClientRect = (documentElement) =>
typeof documentElement.getBoundingClientRect === 'function' ?
function createMessageDeleter({
rateLimitMs,
channel,
authorization,
xSuperProperties,
authorId
}) {
function deleteMessage(message) {
if(message.author.id !== authorId) {