-
Notifications
You must be signed in to change notification settings - Fork 28
Conversation
return this.swarm.unhandle(protocol) | ||
const libp2p = require('libp2p') | ||
|
||
class Node extends libp2p.Node { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes inheritance is just awesome :)
It works \o/ So happy about this refactoring, makes things so much nicer and understandable @dignifiedquire Not sure if I should consider your comment as a positive CR, but I believe it is safe to assume that if you found an issue, you would comment right away :) Will merge once CI is green |
@diasdavid I didn't do any real CR yet will do tomorrow |
thank you :) |
while you are at it :) ipfs-inactive/js-libp2p-ipfs-browser#126 |
this.routing = null | ||
this.records = null | ||
module.exports = { | ||
Node: Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just module.exports = Node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, my thinking is that spawning new libp2p.Node
is more intuitive than spawning new Libp2p
, would you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specially in a library that its name is an ecosystem of stuff connecting to other stuff (abstraction ⛰ )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really, I would just like to write
const Node = require('libp2p-ipfs')
const myNode = new Node()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"fine :D"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done :)
ref: libp2p/js-libp2p#43