import { useCallback, useEffect, useRef, useState } from "react";
export function useIntersectionObserver(options?: IntersectionObserverInit) {
const [isIntersecting, setIsIntersecting] = useState(false);
const nodeRef = useRef<Element | null>(null);
const optionsKey = JSON.stringify(options ?? {});
module KeysetPaginatable
extend ActiveSupport::Concern
class_methods do
def keyset_page(cursor: nil, limit: 20, direction: :desc)
limit = limit.to_i.clamp(1, 100)
package feed
import (
"encoding/base64"
"encoding/json"
"time"
import base64
import json
from datetime import datetime
from typing import NamedTuple
from fastapi import HTTPException
function encodeCursor(row) {
if (!row) return null;
const payload = JSON.stringify({ t: row.created_at, id: row.id });
return Buffer.from(payload, 'utf8').toString('base64url');
}