From 6fe2b52f6860916a62bf9a4d680a0a3b91b50d91 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Wed, 29 Nov 2023 10:10:04 -0800
Subject: Get more rigorous about getAgent() consistency (#2026)

* Get more rigorous about getAgent() consistency

* Update the feed wrapper API to use getAgent() directly
---
 src/state/session/index.tsx | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'src/state/session/index.tsx')

diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx
index 946c742ad..e6def1fab 100644
--- a/src/state/session/index.tsx
+++ b/src/state/session/index.tsx
@@ -13,6 +13,12 @@ import {useCloseAllActiveElements} from '#/state/util'
 
 let __globalAgent: BskyAgent = PUBLIC_BSKY_AGENT
 
+/**
+ * NOTE
+ * Never hold on to the object returned by this function.
+ * Call `getAgent()` at the time of invocation to ensure
+ * that you never have a stale agent.
+ */
 export function getAgent() {
   return __globalAgent
 }
-- 
cgit 1.4.1

