class CacheNamespace
attr_reader :name
def initialize(name, store: Rails.cache)
@name = name.to_s
@store = store
const CACHE_NAME = 'swr-api-v1';
const STAMP_HEADER = 'x-cached-at';
async function open() {
return caches.open(CACHE_NAME);
}
from typing import List, Optional
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from .dataloader import DataLoader
import { useCallback, useEffect, useRef } from 'react';
export function useRafThrottle(callback) {
const savedCallback = useRef(callback);
const frame = useRef(null);
const latestArgs = useRef([]);
class RevenueStat
DEFAULT_RANGE = 30.days
def initialize(account, range: DEFAULT_RANGE)
@account = account
@range = range
from products.models import Product
def import_products_bulk(product_data):
"""Import thousands of products efficiently."""
products = [
import React, { useMemo } from 'react';
import { VirtualList } from './VirtualList';
interface LogEntry {
id: number;
level: 'info' | 'warn' | 'error';
import { lazy, Suspense } from 'react'
import { BrowserRouter, Routes, Route } from 'react-router-dom'
import Layout from '@/components/Layout'
// Eager load critical routes
import Home from '@/pages/Home'
import { useCallback, useEffect, useRef } from "react";
export function useRafThrottle(callback) {
const callbackRef = useRef(callback);
const frameRef = useRef(null);
const latestArgs = useRef([]);
import base64
import json
from datetime import datetime
from typing import Optional, Tuple
import { useMemo } from "react";
export type SortDir = "asc" | "desc";
export interface SortConfig<T> {
key: keyof T;
dir: SortDir;
package com.example.fx.config;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.caffeine.CaffeineCacheManager;