Memoize getAgent method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user