Skip to content

Commit

Permalink
subscription added to web3-module documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Furter committed May 8, 2019
1 parent ab92ce0 commit 846b489
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/web3-module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Example
-------

.. code-block:: javascript
import * as Utils from 'web3-utils';
import {formatters} from 'web3-core-formatters';
import {AbstractWeb3Module} from 'web3-core';
Expand All @@ -48,7 +49,7 @@ Example
class Example extends AbstractWeb3Module {
/**
* @param {AbstractSocketProvider|HttpProvider|String|EthereumProvider} provider
* @param {AbstractSocketProvider|HttpProvider|CustomProvider|String} provider
* @param {Web3ModuleOptions} options
* @param {Net.Socket} nodeNet
*
Expand All @@ -64,6 +65,10 @@ Example
return method.execute();
}
logs(options) {
return new LogSubscription(options, Utils, formatters, this, new GetPastLogsMethod(Utils, formatters, this));
}
}
const example = new Example(provider, net, options);
Expand All @@ -79,3 +84,6 @@ Example
const block = example.getBlockByNumber(1).then(console.log);
// > {}
example.logs(options).subscribe(console.log);
> {}

0 comments on commit 846b489

Please sign in to comment.