break(group): replace onCancel by returning cancel#68
Conversation
🦋 Changeset detectedLatest commit: e91ba5c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
`cancel` - Consistent API with individual prompts - Less indirection => less confusing - Don't wrap partial results in object => simplify destruction - Same amount of LOC - Rewrite docs - Simplify implementation - Remove nonsense `.catch()` handler - Remove error prone `any` cast
5537ce5 to
27b4185
Compare
|
Hmm, I don't disagree that this is more consistent, but I think Thoughts? |
Valid point, but I don't think the flexibility is called for. What would you do with such information? As a user, I expect I think we should try hard to keep the API minimal and simple as possible and not design for hypothetical future usages no one potentially ever uses. But that's just my take. |
|
@ulken Follow upI am not against the simplicity and consistency, but again my goal was to create a wrapper utility function within prompts to add grouping and also by solving the case for We had similar request here on issues #37 and #54 that describe that they wanted to see the some type of Limitations of implementation
ConclusionI think there might be alternative solution but as of right now I am not for sure what that looks like. Hopefully we can come up with something that work in both cases and doesn't have to be one way or another. I think both have there pros and cons. Happy to discuss more about with more developers to get there take so then we can get a good solution for the v1 release. Thanks, |
|
Thanks for chiming in @cpreston321! I think I agree that the current API feels a bit odd, but I do think it solves some valid issues with the Would love to think through some alternative APIs for cancellation. Maybe something with |
|
Going to close this for now but I'd love to continue the discussion. Let's discuss in #83. |
Might be a little controversial, but I still wanted to present the case, which I find favorable.
.catch()handleranycastNote: this would be a breaking change, so either we would have to hold off until
1.0.0or be less semver strict (which I think is fine before1.0.0is released). Might want to do aminorat least? Changeset should be updated if so.