mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 08:38:50 +00:00
finish removing ramda.
This commit is contained in:
8
pool.js
8
pool.js
@@ -1,8 +1,6 @@
|
||||
import {getEventHash, signEvent} from './event'
|
||||
import {relayConnect, normalizeRelayURL} from './relay'
|
||||
|
||||
const R = require('ramda')
|
||||
|
||||
export function relayPool(globalPrivateKey) {
|
||||
const relays = {}
|
||||
const globalSub = []
|
||||
@@ -101,7 +99,9 @@ export function relayPool(globalPrivateKey) {
|
||||
}
|
||||
}
|
||||
|
||||
await R.map(async relay => {
|
||||
Object.values(relays)
|
||||
.filter(({policy}) => policy.write)
|
||||
.map(async ({relay}) => {
|
||||
try {
|
||||
await relay.publish(event)
|
||||
statusCallback(0, relay.url)
|
||||
@@ -115,7 +115,7 @@ export function relayPool(globalPrivateKey) {
|
||||
} catch (err) {
|
||||
statusCallback(-1, relay.url)
|
||||
}
|
||||
}, R.filter(R.pipe(R.prop('policy'), R.prop('write'), R.equals(true)), relays))
|
||||
})
|
||||
|
||||
return event
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user