Profile / Thread styles

This commit is contained in:
2023-07-24 15:30:21 +01:00
parent d292e658fc
commit 076d5d8cd5
67 changed files with 684 additions and 602 deletions

View File

@ -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(),
);
};

View File

@ -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(),
);
}

View File

@ -18,6 +18,6 @@ export function useUserProfile(system: NostrSystem, pubKey?: HexKey): MetadataCa
}
};
},
() => system.ProfileLoader.Cache.getFromCache(pubKey)
() => system.ProfileLoader.Cache.getFromCache(pubKey),
);
}