mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-16 23:45:33 +01:00
16 lines
430 B
TypeScript
16 lines
430 B
TypeScript
|
|
import { useRecoilCallback } from 'recoil';
|
||
|
|
import store from '~/store';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Hook that provides lazy access to addedConvo without subscribing to changes.
|
||
|
|
* Use this to avoid unnecessary re-renders when addedConvo changes.
|
||
|
|
*/
|
||
|
|
export default function useGetAddedConvo() {
|
||
|
|
return useRecoilCallback(
|
||
|
|
({ snapshot }) =>
|
||
|
|
() =>
|
||
|
|
snapshot.getLoadable(store.conversationByKeySelector(1)).getValue(),
|
||
|
|
[],
|
||
|
|
);
|
||
|
|
}
|