Skip to content

Commit

Permalink
release 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ali77gh committed Apr 6, 2023
1 parent 8719e19 commit 9752204
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@

# 1.4.0

* debounce feature added.
* debounce feature added.

# 1.4.2

* performance improve
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Easy to use <b>State manager</b> for flutter based on observer:eyes: design patt
``` Telescope is more than a normal observer. ```

Telescope:telescope:
<br>
0. Supports all platforms.
1. Easy to learn:book:
1. You can learn it in 5-10 min by reading README.
Expand Down
7 changes: 4 additions & 3 deletions lib/src/telescope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ class Telescope<T> {
void calAndUpdate() {
isCalculating?.value = true;
int dh = getDependenciesHash();
void inner(){
void inner() {
cal().then((value) {
if (enableCaching) {
hashmap[dh] = value;
if (cacheExpireTime != null) {
var expTime = DateTime.now().add(cacheExpireTime);
expireTimeMap[dh] = expTime;
Future.delayed(cacheExpireTime, (){
Future.delayed(cacheExpireTime, () {
expireTimeMap.remove(dh);
});
}
Expand All @@ -107,13 +107,14 @@ class Telescope<T> {
notifyAll();
});
}

if (debounceTime != Duration.zero) {
Future.delayed(debounceTime, () {
int cdh = getDependenciesHash();
if (dh != cdh) return;
inner();
});
}else{
} else {
inner();
}
}
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: telescope
description: A simple and easy to use state manager for flutter based on observable pattern with useful out of the box features.
version: 1.4.0
version: 1.4.2
repository: https://github.com/ali77gh/Telescope
homepage: https://github.com/ali77gh/Telescope

Expand Down

0 comments on commit 9752204

Please sign in to comment.