From fef1bad2644ba9f7b2a2215b05b68b6ad4f287a8 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 9 Jun 2026 14:45:27 -0500 Subject: [PATCH] Add a type --- src/state/cache/profile-shadow.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/state/cache/profile-shadow.ts b/src/state/cache/profile-shadow.ts index e649b435c8..d911401b02 100644 --- a/src/state/cache/profile-shadow.ts +++ b/src/state/cache/profile-shadow.ts @@ -53,8 +53,9 @@ const shadows: WeakMap< > = new WeakMap() const emitter = new EventEmitter() +type ShadowUpdateEventPayload = {did: string; shadow: Partial} export function useOnUpdateProfileShadow( - onUpdate: (props: {did: string; shadow: Partial}) => void, + onUpdate: (payload: ShadowUpdateEventPayload) => void, ) { useEffect(() => { emitter.addListener('shadow-update', onUpdate) @@ -217,7 +218,10 @@ export function updateProfileShadow( } batchedUpdates(() => { emitter.emit(did, value) - emitter.emit('shadow-update', {did, shadow: value}) + emitter.emit('shadow-update', { + did, + shadow: value, + } satisfies ShadowUpdateEventPayload) }) }