Lee Ash

Results 46 comments of Lee Ash
trafficstars

I think this could help https://pdfs.semanticscholar.org/0120/1a9d77687d5e97419ad2b9a4eaf3981a5012.pdf

hCaptcha https://www.hcaptcha.com/ works with an AI and an Ethereum token. This is centralized but this is a good compromise.

> @hazae41 Thank you for sharing that paper! If I remember well, this paper was refenced by Juan Benet https://www.semanticscholar.org/paper/IPFS-Content-Addressed%2C-Versioned%2C-P2P-File-System-Benet/02f1d9f5ec925dee3f5d483585f6beab0660aa0f

# Production-ready solution Note: An AbortController is created with each request ```typescript export function useSWRAbort( key: keyInterface, fn?: fetcherFn, options?: ConfigInterface ): responseInterface & { abort: () => void }...

This also happens on automatic revalidation

Ok, this comes to the fact that `mutate()` becomes `mutate(undefined)` Fix is: ```typescript const refresh = useCallback(() => { res.mutate(d => d, true) }, [res.mutate]) ```

Still happens on beta 8, all pages are revalidated when doing `mutate(undefined)` ```typescript const refresh = useCallback(() => { res.mutate(d => d, true) }, [res.mutate]) ```

I did this workaround, it works fine but I think it can be improved performance-wise ```typescript import { useCallback, useEffect, useRef, useState } from "react"; export function useIdle(delay: number) {...

Just use an extra "should" state with an useEffect ```typescript const [shouldLoadMore, setShouldLoadMore] = useState(false) const observer = useMemo(() => { return new IntersectionObserver(([e]) => { if (e) setShouldLoadMore(e.isIntersecting) })...

I tried and it doesn't revalidate, but I want it to revalidate if the stale data is older than the deduping interval