Goon — self-hosted aggregator for adult-content scene metadata. Indexes scenes from TPDB, StashDB, and 30+ public adult tube sites. Cross-source deduplication via perceptual hash + Levenshtein distance. FastAPI backend + APScheduler worker + React Native (Expo) mobile client. FOSS, ad-free, donation-funded. See README for details.
14 lines
470 B
TypeScript
14 lines
470 B
TypeScript
import React, { createContext, useContext } from 'react';
|
|
import { GoonClient } from './api';
|
|
|
|
const Ctx = createContext<GoonClient | null>(null);
|
|
|
|
export function ClientProvider({ client, children }: { client: GoonClient; children: React.ReactNode }) {
|
|
return <Ctx.Provider value={client}>{children}</Ctx.Provider>;
|
|
}
|
|
|
|
export function useClient(): GoonClient {
|
|
const c = useContext(Ctx);
|
|
if (!c) throw new Error('useClient outside ClientProvider');
|
|
return c;
|
|
}
|