feat: polls (#451)

Co-authored-by: silberengel <silberengel7@protonmail.com>
This commit is contained in:
Cody Tseng 2025-07-27 12:05:50 +08:00 committed by GitHub
parent 636ceacdad
commit b35e0cf850
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1240 additions and 130 deletions

View file

@ -0,0 +1,9 @@
import pollResults from '@/services/poll-results.service'
import { useSyncExternalStore } from 'react'
export function useFetchPollResults(pollEventId: string) {
return useSyncExternalStore(
(cb) => pollResults.subscribePollResults(pollEventId, cb),
() => pollResults.getPollResults(pollEventId)
)
}