ഉള്ളടക്കത്തിലേക്ക് പോകുക
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 പാക്കേജുകൾ