Memoize getAgent method
This commit is contained in:
@@ -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() {
|
() => ({
|
||||||
return __globalAgent
|
getAgent() {
|
||||||
},
|
return __globalAgent
|
||||||
}
|
},
|
||||||
|
}),
|
||||||
|
[],
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SessionAccount = persisted.PersistedAccount
|
export type SessionAccount = persisted.PersistedAccount
|
||||||
|
|||||||
Reference in New Issue
Block a user