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

Fix quick flash in the UI when first load the cache. #93

Open
levibostian opened this issue May 11, 2020 · 0 comments
Open

Fix quick flash in the UI when first load the cache. #93

levibostian opened this issue May 11, 2020 · 0 comments

Comments

@levibostian
Copy link
Owner

When Teller first loads up, it will load with a DataState of "none". Teller internally requires this state so the state machine can move to valid nodes when you set requirements on the Repository.

However, the UI of the app should not be observing this none state. Why? Because your app might have something like an animation in your app that switches between states. Animation plus a very fast (milliseconds) observing of DataState in Teller between the "none" state and a valid state with a cache causes your UI to have a weird flicker effect in it.

Proposal

When a DataState is in the "none" state, do not deliver that to observers. Let them wait those few milliseconds until the cache is observed and the UI can receive a real response.

What I expect to happen after this change

If we had an example app in this repo, before this fix, you would observe a Teller repository. You would receive a DataState of type none and then very quickly after, you would receive a DataState not of type none. After this fix, you would only receive a DataState not of type none and the none type is ignored.

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

No branches or pull requests

1 participant