Fix pool sub example
This commit is contained in:
parent
b8aa75b6e1
commit
9530849f0a
14
README.md
14
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 => {
|
||||
// this will only be called once the first time the event is received
|
||||
// ...
|
||||
})
|
||||
)
|
||||
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 =>
|
||||
|
|
Loading…
Reference in New Issue