Skip to content

chore(stackflow/core): Type inference friendly divideBy#557

Merged
tonyfromundefined merged 5 commits intodaangn:mainfrom
ENvironmentSet:smarter-divideby
Jan 20, 2025
Merged

chore(stackflow/core): Type inference friendly divideBy#557
tonyfromundefined merged 5 commits intodaangn:mainfrom
ENvironmentSet:smarter-divideby

Conversation

@ENvironmentSet
Copy link
Collaborator

Description

Current type definition of divideBy has loose typing that makes programmer to use unnecessary assertions or additional checks. I've changed the type so that we can remove uncomfortable assertions.

Checkpoints

  • Since there is no 'negated type' in typescript, Unsatisfied cases remains to be value of the type T. (Exclude is not an option)
  • divideBy's being parameterized by two unrelated types was considered but eventually excluded since it does not work well with the type checker's design. (Due to subtyping, it is possible for the type checker to infer an variable as too general type)
@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2025

🦋 Changeset detected

Latest commit: 2035a02

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackflow/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
stackflow-docs ✅ Ready (Inspect) Visit Preview Jan 19, 2025 2:40pm
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 19, 2025

Open in Stackblitz@stackflow/demo

yarn add https://pkg.pr.new/@stackflow/core@557.tgz 

commit: 2035a02

@tonyfromundefined tonyfromundefined merged commit 5fc54cb into daangn:main Jan 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants