feat: polls (#451)
Co-authored-by: silberengel <silberengel7@protonmail.com>
This commit is contained in:
parent
636ceacdad
commit
b35e0cf850
35 changed files with 1240 additions and 130 deletions
9
src/hooks/useFetchPollResults.tsx
Normal file
9
src/hooks/useFetchPollResults.tsx
Normal 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)
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue