Profile / Thread styles
This commit is contained in:
@ -8,7 +8,7 @@ import { unwrap } from "@snort/shared";
|
||||
const useRequestBuilder = <TStore extends NoteStore, TSnapshot = ReturnType<TStore["getSnapshotData"]>>(
|
||||
system: SystemInterface,
|
||||
type: { new (): TStore },
|
||||
rb: RequestBuilder | null
|
||||
rb: RequestBuilder | null,
|
||||
) => {
|
||||
const subscribe = (onChanged: () => void) => {
|
||||
if (rb) {
|
||||
@ -33,7 +33,7 @@ const useRequestBuilder = <TStore extends NoteStore, TSnapshot = ReturnType<TSto
|
||||
};
|
||||
return useSyncExternalStore<StoreSnapshot<TSnapshot>>(
|
||||
v => subscribe(v),
|
||||
() => getState()
|
||||
() => getState(),
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -5,6 +5,6 @@ import { ExternalStore } from "@snort/shared";
|
||||
export function useSystemState(system: ExternalStore<SystemSnapshot>) {
|
||||
return useSyncExternalStore<SystemSnapshot>(
|
||||
cb => system.hook(cb),
|
||||
() => system.snapshot()
|
||||
() => system.snapshot(),
|
||||
);
|
||||
}
|
||||
|
@ -18,6 +18,6 @@ export function useUserProfile(system: NostrSystem, pubKey?: HexKey): MetadataCa
|
||||
}
|
||||
};
|
||||
},
|
||||
() => system.ProfileLoader.Cache.getFromCache(pubKey)
|
||||
() => system.ProfileLoader.Cache.getFromCache(pubKey),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user