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

refactor(types): prefer type alias #625

Merged
merged 2 commits into from
Nov 2, 2021
Merged

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Nov 2, 2021

I know this is mostly about preference, but I feel a little bad about mixing two styles for maintainability.
There are some differences between interface and type alias, like overloading, index signature and maybe others.
However, in the current code, mostly type alias is used and only some cases use interface. Hopefully making it consistent makes sense. (In this PR, to type alias.)
If this causes a real problem rather than styling preference, we can revisit. (I can think of one case, module augmentation, but wonder if anyone does it, and if it's the case, we should prefer "export function" too.)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 2, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b4971b5:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
React Parcel Configuration
Next.js Configuration

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

Size Change: 0 B

Total Size: 11.2 kB

ℹ️ View Unchanged
Filename Size
dist/context.js 622 B
dist/esm/context.js 521 B
dist/esm/index.js 1.23 kB
dist/esm/middleware.js 2.78 kB
dist/esm/shallow.js 272 B
dist/esm/vanilla.js 520 B
dist/index.js 1.35 kB
dist/middleware.js 2.94 kB
dist/shallow.js 318 B
dist/vanilla.js 630 B

compressed-size-action

@dai-shi dai-shi merged commit 7fc3c49 into main Nov 2, 2021
@dai-shi dai-shi deleted the reafactor/types/prefer-type-alias branch November 2, 2021 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant