SharePolicy: ((peerId, documentId?) => Promise<boolean>)

A function that determines whether we should share a document with a peer

Type declaration

    • (peerId, documentId?): Promise<boolean>
    • Parameters

      Returns Promise<boolean>

Remarks

This function is called by the Repo every time a new document is created or discovered (such as when another peer starts syncing with us). If this function returns true then the Repo will begin sharing the new document with the peer given by peerId.