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

feat(full-stack signals): make operations thenable #2799

Merged
merged 36 commits into from
Oct 22, 2024

Conversation

cromoteca
Copy link
Contributor

@cromoteca cromoteca commented Oct 7, 2024

This pull request introduces a feature to make operations "thenable", which means it implements the ability for operations to return promise-like objects that can be chained. Those objects are in the result properties to avoid the return type themselves to be treated as promises by lint checkers.

Closes #2712

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 95.65217% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.64%. Comparing base (beeccf4) to head (b8da3ba).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/ts/react-signals/src/FullStackSignal.ts 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2799      +/-   ##
==========================================
+ Coverage   92.60%   92.64%   +0.03%     
==========================================
  Files          83       83              
  Lines        2812     2840      +28     
  Branches      724      728       +4     
==========================================
+ Hits         2604     2631      +27     
- Misses        156      157       +1     
  Partials       52       52              
Flag Coverage Δ
unittests 92.64% <95.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cromoteca cromoteca marked this pull request as ready for review October 8, 2024 14:39
@cromoteca cromoteca requested a review from Lodin October 8, 2024 14:40
@cromoteca cromoteca marked this pull request as draft October 9, 2024 10:56
@cromoteca cromoteca marked this pull request as ready for review October 9, 2024 13:12
@cromoteca cromoteca marked this pull request as draft October 10, 2024 13:35
@cromoteca cromoteca removed the request for review from Lodin October 10, 2024 13:35
@cromoteca cromoteca marked this pull request as ready for review October 11, 2024 15:46
packages/ts/react-signals/test/ValueSignal.spec.tsx Outdated Show resolved Hide resolved
packages/ts/react-signals/src/ValueSignal.ts Outdated Show resolved Hide resolved
packages/ts/react-signals/src/ValueSignal.ts Outdated Show resolved Hide resolved
@cromoteca cromoteca requested a review from taefi October 17, 2024 08:50
@cromoteca cromoteca requested a review from taefi October 21, 2024 08:07
taefi
taefi previously approved these changes Oct 21, 2024
@taefi
Copy link
Contributor

taefi commented Oct 21, 2024

Also ListSignal's operations need another follow-up PR to enable the thenables, right?

@cromoteca cromoteca marked this pull request as draft October 21, 2024 13:25
@cromoteca cromoteca marked this pull request as ready for review October 22, 2024 07:50
@cromoteca cromoteca requested a review from taefi October 22, 2024 07:50
@@ -65,19 +74,18 @@ export class ValueSignal<T> extends FullStackSignal<T> {
*
* @param callback - The function that is applied on the current value to
* produce the new value.
* @returns An operation subscription that can be canceled.
* @returns An operation object that allows to perform additional actions, including cancellation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @returns An operation object that allows to perform additional actions, including cancellation.
* @returns An operation object that allows to perform additional actions,
* including cancellation.

Copy link

@cromoteca cromoteca merged commit 83717bc into main Oct 22, 2024
15 checks passed
@cromoteca cromoteca deleted the feat/2712/make-operations-thenable branch October 22, 2024 14:40
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.

[Full-stack Signals] Make signal operations thenable
2 participants