உள்ளடக்கத்துக்குச் செல்
Yuva subscribe hookமெனு

Yuva subscribe hook

A React hook over the useyuva headless client: the channel's public mailing lists, subscribing from a form with its form token, and the signed-in user's subscriptions with an identity token.

Loading

    முன்னோட்டம் மாதிரித் தரவில் இயங்குகிறது. நெட்வொர்க்கோ சேனலோ தேவையில்லை.

    நிறுவல்

    இதை ஒரு shadcn திட்டத்தில் இயக்குங்கள். கோப்புகள் உங்கள் சொந்தக் குறியீட்டில் நகலெடுக்கப்படும்.

    Shell
    npx shadcn@latest add https://useyuva.com/r/use-yuva-subscribe.json

    பயன்பாடு

    tsx
    import { useYuvaSubscribe } from "@/hooks/use-yuva-subscribe"
    
    const { lists, states, subscribe, setSubscribed } = useYuvaSubscribe({ server, channel })

    Props

    UseYuvaSubscribeOptions

    Propவகை
    server?string
    channel?string
    client?YuvaClient
    identityToken?IdentityTokenSource | null
    lists?string[]

    YuvaSubscribeState

    Propவகை
    inboxNamestring
    listsClientMailingList[]
    statesRecord<string, SubscriptionState | undefined>
    identifiedboolean
    loadingboolean
    errorunknown
    subscribe(input: YuvaSubscribeInput) => Promise<{ confirmation: boolean }>
    setSubscribed(listId: string, on: boolean, consentText: string) => Promise<SubscriptionState>

    சார்புகள்

    இந்த உருப்படியை நிறுவினால் கீழுள்ளவையும் சேர்க்கப்படும்.

    npm தொகுப்புகள்