مواد پر جائیں
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 پیکیجز