acc9c84e2e
* Configure functions module to allow absolute imports * Convert common imports in functions to be absolute * Convert common imports in web to be absolute * Convert lib imports in web to be absolute * Convert hooks imports in web to be absolute * Convert components imports in web to be absolute
14 lines
348 B
TypeScript
14 lines
348 B
TypeScript
import { useEffect, useState } from 'react'
|
|
import { Txn } from 'common/txn'
|
|
import { listenForCharityTxns } from 'web/lib/firebase/txns'
|
|
|
|
export const useCharityTxns = (charityId: string) => {
|
|
const [txns, setTxns] = useState<Txn[]>([])
|
|
|
|
useEffect(() => {
|
|
return listenForCharityTxns(charityId, setTxns)
|
|
}, [charityId])
|
|
|
|
return txns
|
|
}
|