Skip to content

Commit

Permalink
Merge pull request #3326 from ethereum/issue/3319
Browse files Browse the repository at this point in the history
Add types for subscription.on(connected)
  • Loading branch information
nivida authored Jan 22, 2020
2 parents 7386be2 + d9ac8c1 commit 5a53ae9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ Released with 1.0.0-beta.37 code base.
### Changed

- Ensure '0x' prefix is existing for Accounts.sign and Accounts.privateKeyToAccount (#3041)

### Fixed

- Add missing subscription.on('connected') TS type definition (#3319)
2 changes: 2 additions & 0 deletions packages/web3-core-subscriptions/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class Subscription<T> {

on(type: 'changed', handler: (data: T) => void): Subscription<T>;

on(type: 'connected', handler: (subscriptionId: string) => void): Subscription<T>;

on(type: 'error', handler: (data: Error) => void): Subscription<T>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ subscription.on('changed', () => {});

// $ExpectType Subscription<unknown>
subscription.on('error', () => {});

// $ExpectType Subscription<unknown>
subscription.on('connected', () => {});
2 changes: 1 addition & 1 deletion scripts/e2e.mosaic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo "Installing updated web3 via virtual registry "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

git submodule update --init --recursive
yarn --registry http://localhost:4873
yarn --registry http://localhost:4873 --network-timeout 100000

yarn add web3@e2e --registry http://localhost:4873 --network-timeout 100000

Expand Down

0 comments on commit 5a53ae9

Please sign in to comment.