Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt. roe.dev
Something went wrong. Try again.
1234567891011121314151617181920212223import process from 'node:process'import { useRuntimeConfig } from 'nuxt/server'
import { createParty } from './server'import type { Party } from './server'import { usePartyStore } from './store'
let party: Promise<Party> | undefined
export function useParty () { return party ||= usePartyStore().then(store => { const { token } = useRuntimeConfig().party return createParty({ store, authorise: candidate => token ? candidate === token : !!import.meta.dev, prefix: `${process.env.VERCEL_ENV || 'development'}:`, }) }, err => { party = undefined throw err })}