Improve DVM feeds
This commit is contained in:
@@ -37,6 +37,7 @@ export type SubscribeRequest = {
|
||||
relays: string[]
|
||||
filters: Filter[]
|
||||
timeout?: number
|
||||
tracker?: Tracker
|
||||
immediate?: boolean
|
||||
closeOnEose?: boolean
|
||||
}
|
||||
@@ -53,8 +54,8 @@ export type Subscription = {
|
||||
export const makeSubscription = (request: SubscribeRequest) => {
|
||||
const id = randomId()
|
||||
const emitter = new Emitter()
|
||||
const tracker = new Tracker()
|
||||
const result = defer<Event[]>()
|
||||
const tracker = request.tracker || new Tracker()
|
||||
const close = () => emitter.emit('abort')
|
||||
|
||||
emitter.setMaxListeners(100)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@welshman/net",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"author": "hodlbod",
|
||||
"license": "MIT",
|
||||
"description": "Utilities for connecting with nostr relays.",
|
||||
@@ -32,8 +32,8 @@
|
||||
"typescript": "~5.1.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@welshman/lib": "0.0.1",
|
||||
"@welshman/util": "0.0.1",
|
||||
"@welshman/lib": "0.0.2",
|
||||
"@welshman/util": "0.0.2",
|
||||
"isomorphic-ws": "^5.0.0",
|
||||
"ws": "^8.16.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user