queryForUpdates method
Queries your data source for updates every queryInterval Returns true if there are new posts, false otherwise
Implementation
Stream<bool> queryForUpdates() async* {
if (feed.isEmpty) {
feed = await cache.retriveAll();
}
while (true) {
try {
final newFeed = await feedProvider.parseFeed();
if (feed.length != newFeed.length) {
feed = newFeed;
yield true;
} else {
yield false;
}
} catch (e) {
yield false;
}
await Future.delayed(queryInterval);
}
}