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: Added to allow setting the validity period of hydrated data. #4332

Closed
wants to merge 2 commits into from

Conversation

devstar1224
Copy link

@devstar1224 devstar1224 commented Jan 13, 2025

Status

READY

Breaking Changes

NO

Description

  • Added to allow setting the validity period of hydrated data.

Example

class CounterCubit extends HydratedCubit<int> {
  CounterCubit() : super(0, storage: EncryptedStorage());

  void increment() => emit(state + 1);

  @override
  int fromJson(Map<String, dynamic> json) => json['value'] as int;

  @override
  Map<String, int> toJson(int state) => { 'value': state };

  @override
  Duration? get hydrationExpiresIn => const Duration(minutes: 1);
}

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@devstar1224 devstar1224 requested a review from felangel as a code owner January 13, 2025 08:01
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 41.66667% with 14 lines in your changes missing coverage. Please review.

Project coverage is 98.30%. Comparing base (635e675) to head (f518f77).
Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
packages/hydrated_bloc/lib/src/hydrated_bloc.dart 41.66% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master    #4332      +/-   ##
===========================================
- Coverage   100.00%   98.30%   -1.70%     
===========================================
  Files           32       32              
  Lines          806      828      +22     
===========================================
+ Hits           806      814       +8     
- Misses           0       14      +14     
Flag Coverage Δ
hydrated_bloc 92.00% <41.66%> (-8.00%) ⬇️

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.

@devstar1224 devstar1224 changed the title Added to allow setting the validity period of hydrated data. feat: Added to allow setting the validity period of hydrated data. Jan 13, 2025
@devstar1224 devstar1224 marked this pull request as draft January 13, 2025 11:04
@felangel
Copy link
Owner

Hi @devstar1224 👋
Thanks for opening a PR!

I think it would be better if we could close this PR for now and move to an issue where we can discuss the problem being solved, align on a solution, and then open a pull request. Thanks so much! 🙏

@felangel felangel closed this Jan 13, 2025
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.

2 participants