Skip to content

Commit

Permalink
chore: Bump version to 0.0.6 and fix value getter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ArunPrakashG committed Jul 6, 2024
1 parent 1f1c740 commit 31a36ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
## 0.0.5

- introduce custom disposer for the value

## 0.0.6

- Fix the issue with value getter
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Integrate `ever_cache` into your project effortlessly. Just sprinkle this into y

```yaml
dependencies:
ever_cache: ^0.0.4
ever_cache: ^0.0.6
```
then run `pub get` or `flutter pub get`.
Expand Down
12 changes: 7 additions & 5 deletions lib/src/ever_cache_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ final class EverCache<T> extends ILockable<T> {
/// If the value is not yet computed, it will be fetched in the background as soon as possible.
@override
T get value {
if (_isDisposed) {
if (disposed) {
throw const EverStateException('Value has been disposed.');
}

if (_value == null) {
computeSync();
if (!computed) {
if (!computing) {
computeSync();
}

if (placeholder != null) {
return placeholder!();
Expand Down Expand Up @@ -133,7 +135,7 @@ final class EverCache<T> extends ILockable<T> {
throw const EverStateException('Value is being evaluated.');
}

if (_value != null && !force) {
if (computed && !force) {
return true;
}

Expand Down Expand Up @@ -169,7 +171,7 @@ final class EverCache<T> extends ILockable<T> {
throw const EverStateException('Value is being evaluated.');
}

if (_value != null && !force) {
if (computed && !force) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ever_cache
description: Allows to cache a computed value for a specific duration.
version: 0.0.5
version: 0.0.6
repository: https://github.com/ArunPrakashG/ever_cache

environment:
Expand Down

0 comments on commit 31a36ca

Please sign in to comment.