This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const archive = await DatArchive.load('someurl') | |
var fooExt = archive.extension('foo') | |
// listen to 'foo' messages from all peers | |
fooExt.addEventListener('message', ({detail}) => { | |
const {message, peer} = detail | |
// send to one peer: | |
await peer.extension('bar').send('Hello World') |