Skip to content

The APIs dont match: Constructor in readme "(_config)", constructor in src/ "(_modules, _peerInfo, _peerBook, _options)" #217

Closed
@mkg20001

Description

@mkg20001
  • Version: 0.20.4
  • Platform: Ubuntu 16.04 x64
  • Subsystem: js-libp2p

Type: bug

Severity: high

Description: The APIs dont match: Constructor in readme "(_config)", constructor in src/ "(_modules, _peerInfo, _peerBook, _options)"

Steps to reproduce the error:

  1. Follow the docs on the README (on npm)
  2. Realize the APIs don't match

The example uses the new-style api, yet the old constructor still requires the old stil API. To avoid mass breakage maybe just add a shim that does if (_modules.peerInfo) {_peerInfo = _modules.peerInfo; _peerBook = _modules.peerBook; _options = _modules.config; _modules = _modules.modules}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions