Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Conversation

@teogeb
Copy link
Contributor

@teogeb teogeb commented Mar 1, 2021

Type annotations for authFetch endpoints (and utils.test.ts).

@teogeb teogeb requested a review from timoxley March 1, 2021 16:05
@teogeb teogeb mentioned this pull request Mar 2, 2021
@teogeb teogeb requested a review from jtakalai March 2, 2021 11:02
Copy link
Contributor

@jtakalai jtakalai left a comment

Choose a reason for hiding this comment

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

Haha TS "laid-back" typing is really a breath of fresh air: sure, let the caller decide what the return type is; if they get it wrong, they get to suffer, whatever :D


// Send data to the stream
return authFetch(
await authFetch(
Copy link
Contributor

Choose a reason for hiding this comment

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

why not return?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the success response POST /​streams/​id/​data is always empty. So it is better to return void than an empty object. Error response rejects the promise.

@teogeb teogeb merged commit e047453 into 5.x Mar 2, 2021
@teogeb teogeb deleted the types-for-authfetch branch March 2, 2021 11:41
teogeb added a commit that referenced this pull request Mar 2, 2021
Types for getAdminAddress, setAdminFee, executeWithdraw. After these modifications, and PR #207 all public methods of DataUnion are annotated with valid types.

Remove deployTxReceipt field which was not used
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