src/providers.js
function loadProviders (store, cid, callback) {
  pull(
    store.query({ prefix: makeProviderKey(cid) }),
    pull.map((entry) => {
      const parts = entry.key.toString().split('/')
      const lastPart = parts[parts.length - 1]
      const rawPeerId = utils.decodeBase32(lastPart)
      return [new PeerId(rawPeerId), readTime(entry.value)]
    }),
    pull.collect((err, res) => {
      if (err) {
        return callback(err)
      }

      return callback(null, new Map(res))
    })
  )
}
function loadProviders (store, cid, callback) {
  pull(
    store.query({ prefix: makeProviderKey(cid) }),
    pull.map((entry) => {
      const parts = entry.key.toString().split('/')
      const lastPart = parts[parts.length - 1]
      const rawPeerId = utils.decodeBase32(lastPart)
      return [new PeerId(rawPeerId), readTime(entry.value)]
    }),
    pull.collect((err, res) => {
      if (err) {
        return callback(err)
      }

      return callback(null, new Map(res))
    })
  )
}
function loadProviders ( store , cid , callback ) { pull ( store . query ( { prefix : makeProviderKey ( cid ) } ) , pull . map ( ( entry ) => { const parts = entry . key . toString ( ) . split ( '/' ) const lastPart = parts [ parts . length - 1 ] const rawPeerId = utils . decodeBase32 ( lastPart ) return [ new PeerId ( rawPeerId ) , readTime ( entry . value ) ] } ) , pull . collect ( ( err , res ) => { if ( err ) { return callback ( err ) } return callback ( null , new Map ( res ) ) } ) ) }
Load providers from the store.

@param {Datastore} store
@param {CID} cid
@param {function(Error, Map<PeerId, Date>)} callback
@returns {undefined}

@private
Load providers from the store .