-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preferred way to instantiate Libp2p bundle? Inherit or static create? #811
Comments
Hello @a1300 The preferred way to instantiate Libp2p is using Regarding the docs, we actually have both documented in https://github.com/libp2p/js-libp2p/blob/master/doc/API.md#create . The |
Hi @vasco-santos Will send a PR for the dialer example |
If you would like to also PR this change, feel free to do it :) |
Update docs examples in PR: #814 |
Type: Question
I found in the examples both the
new Libp2p()
andLibp2p.create()
methods. In the API documentation only thenew Libp2p()
way is shown.Are they the same? Is it safe to inherit from
Libp2p
and add extra methods?Example with
Libp2p.create()
js-libp2p/examples/discovery-mechanisms/1.js
Lines 24 to 27 in d0a9fad
Example with
new Libp2p()
js-libp2p/examples/chat/src/dialer.js
Lines 16 to 21 in d0a9fad
The text was updated successfully, but these errors were encountered: