freshli | A tool for collecting historical metrics about a project | Analytics library
kandi X-RAY | freshli Summary
kandi X-RAY | freshli Summary
A tool for collecting historical metrics about a project's dependencies. The freshli tool captures historical metrics about a project's dependencies. In it's current form, the only metric that it computes is libyear. For each language that the tool supports, the libyear metric is computed for each month in the past where dependency information is available.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of freshli
freshli Key Features
freshli Examples and Code Snippets
Community Discussions
Trending Discussions on freshli
QUESTION
I have a simple app that displays contact list pulled from an API.
I need to display the latest contacts fetch if there is no network at the launch of the app. So that's why I'm working with Room to save the contacts into a database.
The contacts are correctly saved, they are correctly pulled when needed.
But there is a weird problem when I do the following pattern:
- I pull some contacts from the API (auto-saved into the local db)
- I kill the app;
- I cut all network to trigger the pull from the local db;
- I launch the app without any network, contacts are correctly displayed from the local db;
- I open the network to process a fresh call to the API (clean the db and so on...)
- After the response to the call to the API, after the subscribe of the getContacts
call, the subscribe of the getContactsFromDatabase is called !!
So after debugging I found that just the subscribe is called and not the full function getContactsFromDatabase()
because of my breakpoint on the srList.isRefreshing = true
is not triggered. Only the breakpoint in the subscribe part.
I also tried to put a breakpoint to the only part where the getContactsFromDatabase function is called. It's never triggered however the breakpoint in the subscribe is triggered.
You can check my code on Github
ContactListFragment.kt:
...ANSWER
Answered 2020-Jun-25 at 19:10Following these docs:
room/accessing-data#query-rxjava
Flowable/Observable
Every time the user data is updated, the Flowable object will emit automatically, allowing you to update the UI based on the latest data.
In your code, after getContactByPages()
you call saveContactsToDatabase()
to save the data to database
So viewModel.getContactFromDatabase()
(which is point to ContactDao.getContacts()
) will emit data again.
If you want ContactDao.getContacts()
to emit only one time when is called, consider to convert ContactDao.getContacts()
to MayBe
/Single
instead of Observable
Hope this helps.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install freshli
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page