mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
Fix pool sub example
This commit is contained in:
10
README.md
10
README.md
@@ -140,16 +140,14 @@ let relays = ['wss://relay.example.com', 'wss://relay.example2.com']
|
||||
|
||||
let relay = await pool.ensureRelay('wss://relay.example3.com')
|
||||
|
||||
let subs = pool.sub([...relays, relay], {
|
||||
let sub = pool.sub([...relays, relay], [{
|
||||
authors: ['32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245']
|
||||
})
|
||||
}])
|
||||
|
||||
subs.forEach(sub =>
|
||||
sub.on('event', event => {
|
||||
sub.on('event', event => {
|
||||
// this will only be called once the first time the event is received
|
||||
// ...
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
let pubs = pool.publish(relays, newEvent)
|
||||
pubs.forEach(pub =>
|
||||
|
||||
Reference in New Issue
Block a user