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: add keepAlive to Computed #976

Merged

Conversation

amondnet
Copy link
Collaborator

@amondnet amondnet commented Dec 19, 2023

Describe the changes proposed in this Pull Request.

This avoids suspending computed values when they are not being observed by anything (see the above explanation). Can potentially create memory leaks.

Fixes #975


Pull Request Checklist

  • If the changes are being made to code, ensure the version in pubspec.yaml is updated.
  • Increment the major/minor/patch/patch-count, depending on the complexity of change
  • Add the necessary unit tests to ensure the coverage does not drop
  • Update the Changelog to include all changes made in this PR, organized by version
  • Run the melos run set_version command from the root directory
  • Include the necessary reviewers for the PR
  • Update the docs if there are any API changes or additions to functionality

Copy link

netlify bot commented Dec 19, 2023

Deploy Preview for mobx ready!

Name Link
🔨 Latest commit e3a7bc6
🔍 Latest deploy log https://app.netlify.com/sites/mobx/deploys/658c14dac3eefd0008978b02
😎 Deploy Preview https://deploy-preview-976--mobx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@amondnet amondnet force-pushed the 975-feat-add-keepalive-to-computed-1 branch from 9c01892 to 4faf0f4 Compare December 19, 2023 10:59
@amondnet amondnet self-assigned this Dec 19, 2023
@amondnet amondnet linked an issue Dec 19, 2023 that may be closed by this pull request
@amondnet amondnet added the enhancement New feature or request label Dec 19, 2023
Copy link

codecov bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (00fe8b0) 99.00% compared to head (4f3a787) 99.01%.

❗ Current head 4f3a787 differs from pull request most recent head e3a7bc6. Consider uploading reports for the commit e3a7bc6 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #976   +/-   ##
=======================================
  Coverage   99.00%   99.01%           
=======================================
  Files          57       57           
  Lines        2017     2024    +7     
=======================================
+ Hits         1997     2004    +7     
  Misses         20       20           
Flag Coverage Δ
flutter_mobx 100.00% <ø> (ø)
mobx 98.56% <100.00%> (+<0.01%) ⬆️
mobx_codegen 100.00% <100.00%> (ø)
mobx_lint ∅ <ø> (∅)

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

Files Coverage Δ
mobx/lib/src/api/annotations.dart 80.00% <100.00%> (ø)
mobx/lib/src/core/computed.dart 100.00% <100.00%> (ø)
mobx_codegen/lib/src/store_class_visitor.dart 100.00% <100.00%> (ø)
mobx_codegen/lib/src/template/computed.dart 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00fe8b0...e3a7bc6. Read the comment docs.

@amondnet amondnet force-pushed the 975-feat-add-keepalive-to-computed-1 branch 2 times, most recently from 72276a3 to 863c9e2 Compare December 19, 2023 11:02
@pavanpodila
Copy link
Member

Pls resolve the conflicts as we merged the previous PR that bumped the version

Copy link
Member

@pavanpodila pavanpodila left a comment

Choose a reason for hiding this comment

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

looks good overall..need a version bump...also pls check if there is any drop in test coverage

@amondnet amondnet force-pushed the 975-feat-add-keepalive-to-computed-1 branch from 863c9e2 to cd4bf1a Compare December 27, 2023 05:57
@amondnet amondnet force-pushed the 975-feat-add-keepalive-to-computed-1 branch from cd4bf1a to 4f3a787 Compare December 27, 2023 06:03
@amondnet amondnet requested a review from pavanpodila December 27, 2023 06:04
@amondnet
Copy link
Collaborator Author

@pavanpodila I rebased to the main branch and resolved the conflict.

mobx/CHANGELOG.md Outdated Show resolved Hide resolved
@pavanpodila pavanpodila enabled auto-merge (squash) December 27, 2023 10:41
@pavanpodila pavanpodila merged commit 8711e61 into mobxjs:main Dec 27, 2023
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add keepAlive to Computed
2 participants