Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Conversation

@axelchalon
Copy link
Contributor

No description provided.

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@axelchalon axelchalon force-pushed the ac-transactioncountof branch from 4325999 to 6a0188c Compare December 18, 2018 12:44
calls: ['eth_getTransactionCount'],
frequency: [frequency.onEveryBlock$, frequency.onStartup$],
name: 'transactionCountOf$',
pipes: api => [switchMapPromise(() => api.eth.getTransactionCount(address).then(Number))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is then(Number)?

Copy link
Contributor Author

@axelchalon axelchalon Dec 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the Number constructor to convert the value to a number (e.g. "5" to 5)
otherwise the value we receive is an object/string; I thought that it would make sense if transactionCountOf$ returns a number type

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. So in this case the TS def should be createRpc$<any, number | Symbol>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, you're right!

@axelchalon axelchalon force-pushed the ac-transactioncountof branch from 6a0188c to 7d42dfa Compare December 18, 2018 13:19
@axelchalon axelchalon merged commit add7962 into master Dec 18, 2018
@amaury1093 amaury1093 deleted the ac-transactioncountof branch December 18, 2018 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants