Memoize getAgent method

This commit is contained in:
Eric Bailey
2024-04-25 14:07:57 -05:00
parent 7cdd3de3f6
commit a7e3433ecc
+5 -2
View File
@@ -24,11 +24,14 @@ import {readLabelers} from './agent-config'
let __globalAgent: BskyAgent = PUBLIC_BSKY_AGENT let __globalAgent: BskyAgent = PUBLIC_BSKY_AGENT
export function useAgent() { export function useAgent() {
return { return React.useMemo(
() => ({
getAgent() { getAgent() {
return __globalAgent return __globalAgent
}, },
} }),
[],
)
} }
export type SessionAccount = persisted.PersistedAccount export type SessionAccount = persisted.PersistedAccount