mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
12 lines
391 B
TypeScript
12 lines
391 B
TypeScript
import { getActiveRelays } from '@/db/relays.ts';
|
|
import { type Event, RelayPool } from '@/deps.ts';
|
|
|
|
const allRelays = await getActiveRelays();
|
|
const pool = new RelayPool(allRelays);
|
|
|
|
/** Publish an event to the given relays, or the entire pool. */
|
|
function publish(event: Event, relays: string[] = allRelays) {
|
|
return pool.publish(event, relays);
|
|
}
|
|
|
|
export { allRelays, pool, publish };
|