Memoize getAgent method

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