snort/packages/app/src/Feed/EventPublisher.ts

13 lines
364 B
TypeScript
Raw Normal View History

2023-03-28 14:34:01 +00:00
import { useMemo } from "react";
2023-04-14 11:33:19 +00:00
import useLogin from "Hooks/useLogin";
2023-04-14 15:02:15 +00:00
import { EventPublisher } from "System/EventPublisher";
2023-02-13 15:29:25 +00:00
2023-01-15 19:40:47 +00:00
export default function useEventPublisher() {
2023-04-14 15:02:15 +00:00
const { publicKey, privateKey } = useLogin();
return useMemo(() => {
if (publicKey) {
return new EventPublisher(publicKey, privateKey);
2023-04-10 12:53:53 +00:00
}
2023-04-14 15:02:15 +00:00
}, [publicKey, privateKey]);
2023-01-15 19:40:47 +00:00
}