Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Composable type easier on the eyes #162

Merged
merged 3 commits into from
Jul 15, 2024
Merged

Conversation

diogob
Copy link
Contributor

@diogob diogob commented Jul 14, 2024

Before the type Composable would be diplayed as:

const f = composable((x: number) => x)
//    ^? ((x: number) => Promise<Result<number>>) & { kind: "composable"; }

This was really bothering me when using the library, particularly when dealing with composables with an already cluttered return type.
After this PR it resolves to a new type we don't export called ComposableFunction:

const f = composable((x: number) => x)
//    ^? ComposableFunction<(x: number) => number>

@diogob diogob force-pushed the prettify-composable-type branch from 1c6f641 to 7c13b1e Compare July 14, 2024 22:55
@diogob diogob requested a review from gustavoguichard July 14, 2024 22:55
@diogob diogob added the 💅 aesthetics When something could look better label Jul 14, 2024
@diogob diogob marked this pull request as ready for review July 14, 2024 22:58
@diogob diogob merged commit 71ea7c2 into main Jul 15, 2024
1 check passed
@diogob diogob deleted the prettify-composable-type branch July 15, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💅 aesthetics When something could look better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants