feat: show thread

This commit is contained in:
Shusui MOYATANI
2023-03-26 11:29:38 +09:00
parent 904c5a547c
commit 3abd0dd94e
12 changed files with 237 additions and 61 deletions

View File

@@ -2,6 +2,7 @@ import { createSignal, createEffect, onCleanup } from 'solid-js';
import type { Event as NostrEvent, Filter, SubscriptionOptions } from 'nostr-tools';
import uniqBy from 'lodash/uniqBy';
import usePool from '@/nostr/usePool';
import useStats from './useStats';
export type UseSubscriptionProps = {
relayUrls: string[];
@@ -27,7 +28,10 @@ const sortEvents = (events: NostrEvent[]) =>
let count = 0;
setInterval(() => console.log('sub', count), 1000);
const { setActiveSubscriptions } = useStats();
setInterval(() => {
setActiveSubscriptions(count);
}, 1000);
const useSubscription = (propsProvider: () => UseSubscriptionProps | null) => {
const pool = usePool();